Add new goal to choose agent type - only kind of working

This commit is contained in:
Laine
2025-03-07 16:12:21 -05:00
parent 64d2a92630
commit 4117d5d62d
9 changed files with 170 additions and 16 deletions

View File

@@ -6,6 +6,42 @@ from tools.tool_registry import (
book_trains_tool,
create_invoice_tool,
find_events_tool,
change_goal_tool,
choose_agent_tool,
transfer_control_tool
)
starter_prompt_generic = "Welcome me, give me a description of what you can do, then ask me for the details you need to do your job"
goal_choose_agent_type = AgentGoal(
tools=[
choose_agent_tool,
change_goal_tool,
transfer_control_tool
],
description="The user wants to choose which type of agent they will interact with. "
"Help the user gather args for these tools, in order: "
"1. ChooseAgent: Choose which agent to interact with "
"2. ChangeGoal: Change goal of agent "
"3. TransferControl: Transfer control to new agent "
"After these tools are complete, change your goal to the new goal as chosen by the user. ",
starter_prompt=starter_prompt_generic,
example_conversation_history="\n ".join(
[
"user: I'd like to choose an agent",
"agent: Sure! Would you like me to list the available agents?",
"user_confirmed_tool_run: <user clicks confirm on ChooseAgent tool>",
"tool_result: { 'agent_name': 'Event Flight Finder', 'goal_id': 'goal_event_flight_invoice', 'agent_description': 'Helps users find interesting events and arrange travel to them' }",
"agent: The available agents are: 1. Event Flight Finder. Which agent would you like to speak to?",
"user: 1",
"user_confirmed_tool_run: <user clicks confirm on ChangeGoal tool>",
# bot changes goal here and hopefully just...switches??
# could also end 1 workflow and start another with new goal
"tool_result: { 'new_goal': 'goal_event_flight_invoice' }",
"agent: Would you like to transfer control to the new agent now?",
"user: yes",
]
),
)
goal_match_train_invoice = AgentGoal(
@@ -23,7 +59,7 @@ goal_match_train_invoice = AgentGoal(
"2. SearchTrains: Search for trains to the city of the match and list them for the customer to choose from "
"3. BookTrains: Book the train tickets, used to invoice the user for the cost of the train tickets "
"4. CreateInvoice: Invoices the user for the cost of train tickets, with total and details inferred from the conversation history ",
starter_prompt="Welcome me, give me a description of what you can do, then ask me for the details you need to begin your job as an agent ",
starter_prompt=starter_prompt_generic,
example_conversation_history="\n ".join(
[
"user: I'd like to travel to a premier league match",
@@ -61,7 +97,7 @@ goal_event_flight_invoice = AgentGoal(
"1. FindEvents: Find an event to travel to "
"2. SearchFlights: search for a flight around the event dates "
"3. CreateInvoice: Create a simple invoice for the cost of that flight ",
starter_prompt="Welcome me, give me a description of what you can do, then ask me for the details you need to do your job",
starter_prompt=starter_prompt_generic,
example_conversation_history="\n ".join(
[
"user: I'd like to travel to an event",