Add "done" back in for prompts, remove argument from ListAgents tool def

This commit is contained in:
Laine
2025-03-12 09:01:31 -04:00
parent 56cccd660d
commit fdf5550ea3
3 changed files with 4 additions and 10 deletions

View File

@@ -17,7 +17,7 @@ class CombinedInput:
Message = Dict[str, Union[str, Dict[str, Any]]] Message = Dict[str, Union[str, Dict[str, Any]]]
ConversationHistory = Dict[str, List[Message]] ConversationHistory = Dict[str, List[Message]]
NextStep = Literal["confirm", "question", "done"] NextStep = Literal["confirm", "question", "pick-new-goal", "done"]
@dataclass @dataclass

View File

@@ -68,7 +68,7 @@ def generate_genai_prompt(
"Your JSON format must be:\n" "Your JSON format must be:\n"
"{\n" "{\n"
' "response": "<plain text>",\n' ' "response": "<plain text>",\n'
' "next": "<question|confirm|pick-new-goal>",\n' ' "next": "<question|confirm|pick-new-goal|done>",\n'
' "tool": "<tool_name or null>",\n' ' "tool": "<tool_name or null>",\n'
' "args": {\n' ' "args": {\n'
' "<arg1>": "<value1 or null>",\n' ' "<arg1>": "<value1 or null>",\n'
@@ -123,7 +123,7 @@ def generate_tool_completion_prompt(current_tool: str, dynamic_result: dict) ->
f"### The '{current_tool}' tool completed successfully with {dynamic_result}. " 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. " "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. " "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)>"}' '{"next": "<question|confirm|pick-new-goal|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. " "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 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).' 'Next should only be "pick-new-goal" if all tools have been run (use the system prompt to figure that out).'

View File

@@ -3,13 +3,7 @@ from models.tool_definitions import ToolDefinition, ToolArgument
list_agents_tool = ToolDefinition( list_agents_tool = ToolDefinition(
name="ListAgents", name="ListAgents",
description="List available agents to interact with, pulled from goal_registry. ", description="List available agents to interact with, pulled from goal_registry. ",
arguments=[ arguments=[],
ToolArgument(
name="userConfirmation",
type="string",
description="dummy variable to make thing work",
),
],
) )
change_goal_tool = ToolDefinition( change_goal_tool = ToolDefinition(