From 2bc96b7bf6f55df45ef739f53dfb1c223f294aba Mon Sep 17 00:00:00 2001 From: Mark Date: Wed, 4 Dec 2024 15:27:19 +0100 Subject: [PATCH] this is the way --- setup.py | 2 +- sunholo/genai/process_funcs_cls.py | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/setup.py b/setup.py index 6588accb9..3494e4d23 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,6 @@ from setuptools import setup, find_packages -version = '0.113.0' +version = '0.113.1' setup( name='sunholo', diff --git a/sunholo/genai/process_funcs_cls.py b/sunholo/genai/process_funcs_cls.py index 50a10353c..1a52cc3de 100644 --- a/sunholo/genai/process_funcs_cls.py +++ b/sunholo/genai/process_funcs_cls.py @@ -491,7 +491,7 @@ def run_agent_loop(self, chat:ChatSession, content:list, callback=None, guardrai except Exception as e: msg = f"Error sending {content} to model: {str(e)}" - if str(e) == "finish_reason: 10": + if "finish_reason: 10" in str(e): msg = "The Gemini API does not work with this input - you need to try something else. Error is: finish_reason: 10" log.error(msg + f"{traceback.format_exc()}") token_queue.append(msg) @@ -590,6 +590,7 @@ def run_agent_loop(self, chat:ChatSession, content:list, callback=None, guardrai log.warning(f"{fn_result_json} did not work for decide_to_go_on") token = f"Error calling decide_to_go_on with {fn_result=}\n" else: + token = f"--- {fn_log} result --- \n" # if json dict we look for keys to extract if fn_result_json: @@ -621,8 +622,8 @@ def run_agent_loop(self, chat:ChatSession, content:list, callback=None, guardrai if this_text: #content.append(f"Agent: {this_text}") - # update content relying on gemini chat history instead - content = [f"Agent:\n{this_text}"] + # update content relying on gemini chat history instead, and the parsed function result objects + content = executed_responses # if text includes gs:// try to download it image_uploads = extract_gs_images_and_genai_upload(this_text) if image_uploads: