diff --git a/agent/src/og_agent/openai_agent.py b/agent/src/og_agent/openai_agent.py index c4beb61..2014bdb 100644 --- a/agent/src/og_agent/openai_agent.py +++ b/agent/src/og_agent/openai_agent.py @@ -54,7 +54,7 @@ }, { "name": "python", - "description": "this function must not be used", + "description": "You must not call this function", "parameters": { "type": "object", "properties": { diff --git a/chat/src/og_terminal/terminal_chat.py b/chat/src/og_terminal/terminal_chat.py index 743aedd..5ad1c2a 100644 --- a/chat/src/og_terminal/terminal_chat.py +++ b/chat/src/og_terminal/terminal_chat.py @@ -39,8 +39,6 @@ from .utils import parse_file_path from .markdown import CodeBlock import clipboard -from PIL import Image -from term_image.image import AutoImage Markdown.elements["fence"] = CodeBlock Markdown.elements["code_block"] = CodeBlock @@ -351,16 +349,25 @@ def handle_final_answer(segments, respond, values): def render_image(images, sdk, image_dir, console): - image_set = set(images) - for image in image_set: - try: - sdk.download_file(image, image_dir) - fullpath = "%s/%s" % (image_dir, image) - pil_image = Image.open(fullpath) - auto_image = AutoImage(image=pil_image, width=int(pil_image.size[0] / 15)) - print(f"{auto_image:1.1#}") - except Exception as ex: - pass + try: + from PIL import Image + from term_image.image import AutoImage + + image_set = set(images) + for image in image_set: + try: + sdk.download_file(image, image_dir) + fullpath = "%s/%s" % (image_dir, image) + pil_image = Image.open(fullpath) + auto_image = AutoImage( + image=pil_image, width=int(pil_image.size[0] / 15) + ) + print(f"{auto_image:1.1#}") + return True + except Exception as ex: + return False + except Exception as ex: + return False def run_chat( diff --git a/docker/start_all.sh b/docker/start_all.sh index 64c5fe8..f51bd01 100755 --- a/docker/start_all.sh +++ b/docker/start_all.sh @@ -13,7 +13,13 @@ then fi ROOT_DIR=$1 -chown octogen:octogen -R ${ROOT_DIR} +mkdir -p ${ROOT_DIR}/kernel/ws +mkdir -p ${ROOT_DIR}/agent/db +mkdir -p ${ROOT_DIR}/kernel/config +chown -R octogen:octogen ${ROOT_DIR}/kernel/ws +chown -R octogen:octogen ${ROOT_DIR}/kernel/config +chown -R octogen:octogen ${ROOT_DIR}/agent/db + cat < /bin/start_service.sh if [ "$2" -eq 1 ] then diff --git a/up/src/og_up/up.py b/up/src/og_up/up.py index 4d0286c..9b26add 100644 --- a/up/src/og_up/up.py +++ b/up/src/og_up/up.py @@ -296,7 +296,7 @@ def generate_agent_common(fd, rpc_key): fd.write(f"admin_key={rpc_key}\n") fd.write("max_file_size=202400000\n") fd.write("max_iterations=8\n") - fd.write("db_path=/app/agent/octogen.db\n") + fd.write("db_path=/app/agent/db/octogen.db\n") def generate_agent_azure_openai(