From d1b8e150baf8e208dfd0241dd2ce06a36775755f Mon Sep 17 00:00:00 2001 From: Steve Androulakis Date: Thu, 2 Jan 2025 10:29:06 -0800 Subject: [PATCH] tuning --- activities/tool_activities.py | 4 +++- prompts/agent_prompt_generators.py | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/activities/tool_activities.py b/activities/tool_activities.py index 298a8f6..df5759a 100644 --- a/activities/tool_activities.py +++ b/activities/tool_activities.py @@ -35,7 +35,9 @@ class ToolActivities: try: data = json.loads(response.message.content) except json.JSONDecodeError as e: - raise ApplicationError(f"Invalid JSON: {e}") + print(f"Invalid JSON: {e}") + print(response.message.content) + raise json.JSONDecodeError return data diff --git a/prompts/agent_prompt_generators.py b/prompts/agent_prompt_generators.py index afee05b..bc2c788 100644 --- a/prompts/agent_prompt_generators.py +++ b/prompts/agent_prompt_generators.py @@ -73,7 +73,8 @@ def generate_genai_prompt( prompt_lines.append( "6. Use 'next': 'question' if you lack any required arguments based on the history and prompt. " "Use 'next': 'confirm' only if NO arguments are missing. " - "Use 'next': 'done' if no more tool calls are needed." + "Use 'next': 'done' and tool: 'null' if you have successfully completed all tools." + "Don't offer any additional tools beyond the tools listed." ) prompt_lines.append( "7. Keep 'response' user-friendly with no extra commentary. Stick to valid JSON syntax. "