From c192567842674517b500c96d514392bc3a360576 Mon Sep 17 00:00:00 2001 From: mudler Date: Sun, 30 Jul 2023 18:35:30 +0200 Subject: [PATCH] logging and healthchecks --- docker-compose.yaml | 5 +++++ main.py | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index 7683621..acd1dff 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -2,6 +2,11 @@ version: "3.9" services: api: image: quay.io/go-skynet/local-ai:master + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost:8080/readyz"] + interval: 1m + timeout: 120m + retries: 120 ports: - 8090:8080 env_file: diff --git a/main.py b/main.py index e4395f1..6324c66 100644 --- a/main.py +++ b/main.py @@ -9,7 +9,6 @@ from ascii_magic import AsciiArt from duckduckgo_search import DDGS from typing import Dict, List, Optional -logger.add(sys.stderr, format="{time} {level} {message}", filter="miniAGI", level="INFO") # these three lines swap the stdlib sqlite3 lib with the pysqlite3 package for chroma __import__('pysqlite3') import sys @@ -568,6 +567,9 @@ agent_actions = { conversation_history = [] +logger.info("Welcome to miniAGI") +logger.info("Creating avatar, please wait...") + display_avatar() # TODO: process functions also considering the conversation history? conversation history + input