Skip to content

Commit

Permalink
this is the way
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkEdmondson1234 committed Dec 4, 2024
1 parent f6b47c1 commit 2bc96b7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from setuptools import setup, find_packages

version = '0.113.0'
version = '0.113.1'

setup(
name='sunholo',
Expand Down
7 changes: 4 additions & 3 deletions sunholo/genai/process_funcs_cls.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 2bc96b7

Please sign in to comment.