From 32e856e494416d999d84222795ac1837689b29a7 Mon Sep 17 00:00:00 2001 From: Joshua Smith Date: Thu, 17 Apr 2025 15:20:17 -0400 Subject: [PATCH] fixing second goal selection loop with prompts --- prompts/agent_prompt_generators.py | 2 +- workflows/agent_goal_workflow.py | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/prompts/agent_prompt_generators.py b/prompts/agent_prompt_generators.py index 2f9d253..5e247f8 100644 --- a/prompts/agent_prompt_generators.py +++ b/prompts/agent_prompt_generators.py @@ -187,7 +187,7 @@ def generate_pick_new_goal_guidance()-> str: str: A prompt string prompting the LLM to when to go to pick-new-goal """ if is_multi_goal_mode(): - return 'Next should only be "pick-new-goal" if all tools have been run (use the system prompt to figure that out) or the user explicitly requested to pick a new goal. If next is "pick-new-goal" the tool should always be "ListAgents"' + return 'Next should only be "pick-new-goal" if all tools have been run for the current goal (use the system prompt to figure that out) or the user explicitly requested to pick a new goal. If next is "pick-new-goal" the tool should always be "ListAgents"' else: return 'Next should never be "pick-new-goal".' diff --git a/workflows/agent_goal_workflow.py b/workflows/agent_goal_workflow.py index aaee3c5..8f9cd5d 100644 --- a/workflows/agent_goal_workflow.py +++ b/workflows/agent_goal_workflow.py @@ -177,8 +177,16 @@ class AgentGoalWorkflow: next_step = tool_data["next"] = "confirm" current_tool = tool_data["tool"] = "ListAgents" waiting_for_confirm = True - self.confirmed = True - continue + self.tool_data = tool_data + if self.show_tool_args_confirmation: + self.confirmed = False + # if we have all needed arguments (handled above) and not holding for a debugging confirm, proceed: + else: + self.confirmed = True + #self.print_useful_workflow_vars("before adding agent message<-- tool data") + # maybe want to do this sometimes? for now it loops self.add_message("agent", tool_data) + self.print_useful_workflow_vars("after pick-new-goal") + continue # try with this out # else if the next step is to be done with the conversation such as if the user requests it via asking to "end conversation" elif next_step == "done":