added some workflow debugging, converted from "done" to pick-new-goal and updated prompts

This commit is contained in:
Joshua Smith
2025-03-11 15:52:47 -04:00
parent bb733bc966
commit c0a874b90e
2 changed files with 17 additions and 10 deletions

View File

@@ -68,7 +68,7 @@ def generate_genai_prompt(
"Your JSON format must be:\n"
"{\n"
' "response": "<plain text>",\n'
' "next": "<question|confirm|done>",\n'
' "next": "<question|confirm|pick-new-goal>",\n'
' "tool": "<tool_name or null>",\n'
' "args": {\n'
' "<arg1>": "<value1 or null>",\n'
@@ -122,11 +122,11 @@ def generate_tool_completion_prompt(current_tool: str, dynamic_result: dict) ->
return (
f"### The '{current_tool}' tool completed successfully with {dynamic_result}. "
"INSTRUCTIONS: Parse this tool result as plain text, and use the system prompt containing the list of tools in sequence and the conversation history (and previous tool_results) to figure out next steps, if any. "
"You will need to use the tool_results to auto-fill arguments for subsequent tools and also to figure out if all tools have been run."
'{"next": "<question|confirm|done>", "tool": "<tool_name or null>", "args": {"<arg1>": "<value1 or null>", "<arg2>": "<value2 or null>}, "response": "<plain text (can include \\n line breaks)>"}'
"ONLY return those json keys (next, tool, args, response), nothing else."
'Next should be "question" if the tool is not the last one in the sequence.'
'Next should only be "confirm" if all tools have been run (use the system prompt to figure that out).'
"You will need to use the tool_results to auto-fill arguments for subsequent tools and also to figure out if all tools have been run. "
'{"next": "<question|confirm|pick-new-goal>", "tool": "<tool_name or null>", "args": {"<arg1>": "<value1 or null>", "<arg2>": "<value2 or null>}, "response": "<plain text (can include \\n line breaks)>"}'
"ONLY return those json keys (next, tool, args, response), nothing else. "
'Next should be "question" if the tool is not the last one in the sequence. '
'Next should only be "pick-new-goal" if all tools have been run (use the system prompt to figure that out).'
)
def generate_missing_args_prompt(current_tool: str, tool_data: dict, missing_args: list[str]) -> str: