+ );
});
-ConfirmInline.displayName = 'ConfirmInline';
+ConfirmInline.displayName = "ConfirmInline";
-export default ConfirmInline;
+export default ConfirmInline;
\ No newline at end of file
diff --git a/prompts/agent_prompt_generators.py b/prompts/agent_prompt_generators.py
index aaa3844..5d5aad0 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 for the current goal (use the system prompt to figure that out) and the last successful tool was not ListAgents, or the user explicitly requested to pick a new goal.'
+ 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.'
else:
return 'Next should never be "pick-new-goal".'
diff --git a/todo.md b/todo.md
index 42c03cf..4e4e611 100644
--- a/todo.md
+++ b/todo.md
@@ -1,5 +1,6 @@
# todo list
-[ ] expand [tests](./tests/agent_goal_workflow_test.py)
+[x] take steve's confirm box changes https://temporaltechnologies.slack.com/archives/D062SV8KEEM/p1745251279164319
+[ ] consider adding goal categories to goal picker
[ ] adding fintech goals
- Fraud Detection and Prevention - The AI monitors transactions across accounts, flagging suspicious activities (e.g., unusual spending patterns or login attempts) and autonomously freezing accounts or notifying customers and compliance teams.
@@ -12,10 +13,6 @@
[ ] for demo simulate failure - add utilities/simulated failures from pipeline demo
-[x] ecommerce goals
-- [x] add to docs
-- [x] decide about api key names with Laine
-
[ ] LLM failure->autoswitch:
- detect failure in the activity using failurecount
- activity switches to secondary LLM defined in .env
@@ -23,6 +20,10 @@
[ ] for demo simulate failure - add utilities/simulated failures from pipeline demo
+[ ] expand [tests](./tests/agent_goal_workflow_test.py)
+[ ] collapse history/summarize after goal finished
+[ ] add aws bedrock
+
[ ] ask the ai agent how it did at the end of the conversation, was it efficient? successful? insert a search attribute to document that before return
- Insight into the agent’s performance
[ ] non-retry the api key error - "Invalid API Key provided: sk_test_**J..." and "AuthenticationError"
diff --git a/tools/fin/get_account_balances.py b/tools/fin/get_account_balances.py
index be0854c..2c9ad2c 100644
--- a/tools/fin/get_account_balances.py
+++ b/tools/fin/get_account_balances.py
@@ -5,7 +5,7 @@ import json
# this assumes it's a valid account - use check_account_valid() to verify that first
def get_account_balance(args: dict) -> dict:
- account_key = args.get("accountkey")
+ account_key = args.get("email_address_or_account_ID")
file_path = Path(__file__).resolve().parent.parent / "data" / "customer_account_data.json"
if not file_path.exists():
diff --git a/tools/fin/move_money.py b/tools/fin/move_money.py
index 7c0ca5f..eb2bca2 100644
--- a/tools/fin/move_money.py
+++ b/tools/fin/move_money.py
@@ -31,7 +31,7 @@ class MoneyMovementWorkflowParameterObj:
# this assumes it's a valid account - use check_account_valid() to verify that first
async def move_money(args: dict) -> dict:
- account_key = args.get("accountkey")
+ account_key = args.get("email_address_or_account_ID")
account_type: str = args.get("accounttype")
amount = args.get("amount")
destinationaccount = args.get("destinationaccount")
diff --git a/tools/fin/submit_loan_application.py b/tools/fin/submit_loan_application.py
index 8e6771d..e8494bc 100644
--- a/tools/fin/submit_loan_application.py
+++ b/tools/fin/submit_loan_application.py
@@ -31,7 +31,7 @@ class TxResult:
#demonstrate starting a workflow and early return pattern while the workflow continues
async def submit_loan_application(args: dict) -> dict:
- account_key = args.get("accountkey")
+ account_key = args.get("email_address_or_account_ID")
amount = args.get("amount")
loan_status: dict = await start_workflow(amount=amount,account_name=account_key)
diff --git a/tools/goal_registry.py b/tools/goal_registry.py
index 7037826..a25cd0c 100644
--- a/tools/goal_registry.py
+++ b/tools/goal_registry.py
@@ -1,3 +1,4 @@
+import os
from typing import List
from models.tool_definitions import AgentGoal
import tools.tool_registry as tool_registry
@@ -23,24 +24,24 @@ goal_choose_agent_type = AgentGoal(
id = "goal_choose_agent_type",
category_tag="agent_selection",
agent_name="Choose Agent",
- agent_friendly_description="Choose the type of agent to assist you today.",
+ agent_friendly_description="Choose the type of agent to assist you today. You can always interrupt an existing agent to pick a new one.",
tools=[
tool_registry.list_agents_tool,
tool_registry.change_goal_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: "
+ "Help the user select an agent by gathering args for the Changegoal tool, in order: "
"1. ListAgents: List agents available to interact with. Do not ask for user confirmation for this tool. "
"2. ChangeGoal: Change goal of agent "
"After these tools are complete, change your goal to the new goal as chosen by the user. ",
- starter_prompt=starter_prompt_generic + " Begin by listing all details of all agents as provided by the output of the first tool included in this goal. ",
+ starter_prompt= silly_prompt + "Welcome me, give me a description of what you can do, then ask me for the details you need to do your job. List all details of all agents as provided by the output of the first tool included in this goal. ",
example_conversation_history="\n ".join(
[
"agent: Here are the currently available agents.",
- "user_confirmed_tool_run: ",
- "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. \n Which agent would you like to speak to? (You can respond with name or number.)",
- "user: 1, Event Flight Finder",
+ "tool_result: { agents: 'agent_name': 'Event Flight Finder', 'goal_id': 'goal_event_flight_invoice', 'agent_description': 'Helps users find interesting events and arrange travel to them',"
+ "'agent_name': 'Schedule PTO', 'goal_id': 'goal_hr_schedule_pto', 'agent_description': 'Schedule PTO based on your available PTO.' }",
+ "agent: The available agents are: Event Flight Finder and Schedule PTO. \n Which agent would you like to work with? ",
+ "user: I'd like to find an event and book flights using the Event Flight Finder",
"user_confirmed_tool_run: ",
"tool_result: { 'new_goal': 'goal_event_flight_invoice' }",
]
@@ -275,7 +276,7 @@ goal_hr_check_paycheck_bank_integration_status = AgentGoal(
goal_fin_check_account_balances = AgentGoal(
id = "goal_fin_check_account_balances",
category_tag="fin",
- agent_name="Check balances",
+ agent_name="Account Balances",
agent_friendly_description="Check your account balances in Checking, Savings, etc.",
tools=[
tool_registry.financial_check_account_is_valid,
@@ -288,7 +289,7 @@ goal_fin_check_account_balances = AgentGoal(
example_conversation_history="\n ".join(
[
"user: I'd like to check my account balances",
- "agent: Sure! I can help you out with that. May I have your email address or account number?",
+ "agent: Sure! I can help you out with that. May I have your email address and account number?",
"user: email is bob.johnson@emailzzz.com ",
"user_confirmed_tool_run: ",
"tool_result: { 'status': account valid }",
@@ -325,7 +326,7 @@ goal_fin_move_money = AgentGoal(
[
"user: I'd like to transfer some money",
"agent: Sure! I can help you out with that. May I have account number and email address?",
- "user: account number is 11235813",
+ "user: my account number is 11235 and my email address is matt.murdock@nelsonmurdock.com",
"user_confirmed_tool_run: ",
"tool_result: { 'status': account valid }",
"agent: Great! Here are your account balances:",
@@ -349,8 +350,8 @@ goal_fin_move_money = AgentGoal(
goal_fin_loan_application = AgentGoal(
id = "goal_fin_loan_application",
category_tag="fin",
- agent_name="Easy Loan Apply",
- agent_friendly_description="Initiate loan application.",
+ agent_name="Easy Loan",
+ agent_friendly_description="Initiate a simple loan application.",
tools=[
tool_registry.financial_check_account_is_valid,
tool_registry.financial_submit_loan_approval,
@@ -362,7 +363,7 @@ goal_fin_loan_application = AgentGoal(
example_conversation_history="\n ".join(
[
"user: I'd like to apply for a loan",
- "agent: Sure! I can help you out with that. May I have account number for confirmation?",
+ "agent: Sure! I can help you out with that. May I have account number and email address to validate your account?",
"user: account number is 11235813",
"user_confirmed_tool_run: ",
"tool_result: { 'status': account valid }",
@@ -465,3 +466,23 @@ goal_list.append(goal_fin_loan_application)
goal_list.append(goal_ecomm_list_orders)
goal_list.append(goal_ecomm_order_status)
+
+# for multi-goal, just set list agents as the last tool
+first_goal_value = os.getenv("AGENT_GOAL")
+if first_goal_value is None:
+ multi_goal_mode = True # default if unset
+elif first_goal_value is not None and first_goal_value.lower() != "goal_choose_agent_type":
+ multi_goal_mode = False
+else:
+ multi_goal_mode = True
+
+if multi_goal_mode:
+ for goal in goal_list:
+ list_agents_found:bool = False
+ for tool in goal.tools:
+ if tool.name == "ListAgents":
+ list_agents_found = True
+ continue
+ if list_agents_found == False:
+ goal.tools.append(tool_registry.list_agents_tool)
+ continue
\ No newline at end of file
diff --git a/tools/tool_registry.py b/tools/tool_registry.py
index ed19e63..1e76ab4 100644
--- a/tools/tool_registry.py
+++ b/tools/tool_registry.py
@@ -281,7 +281,7 @@ financial_get_account_balances = ToolDefinition(
arguments=[
ToolArgument(
- name="accountkey",
+ name="email_address_or_account_ID",
type="string",
description="email address or account ID of user",
),
@@ -295,26 +295,30 @@ financial_move_money = ToolDefinition(
arguments=[
ToolArgument(
- name="accountkey",
+ name="email_address_or_account_ID",
type="string",
description="email address or account ID of user",
),
- ToolArgument(
+ ToolArgument(
name="accounttype",
type="string",
description="account type, such as checking or savings",
),
- ToolArgument(
+ ToolArgument(
name="amount",
type="string",
description="amount to move in the order",
),
-
- ToolArgument(
+ ToolArgument(
name="destinationaccount",
type="string",
description="account number to move the money to",
),
+ ToolArgument(
+ name="userConfirmation",
+ type="string",
+ description="Indication of user's desire to move money",
+ ),
],
)
@@ -325,7 +329,7 @@ financial_submit_loan_approval = ToolDefinition(
arguments=[
ToolArgument(
- name="accountkey",
+ name="email_address_or_account_ID",
type="string",
description="email address or account ID of user",
),
diff --git a/workflows/agent_goal_workflow.py b/workflows/agent_goal_workflow.py
index 3b2757b..6bc6aee 100644
--- a/workflows/agent_goal_workflow.py
+++ b/workflows/agent_goal_workflow.py
@@ -169,35 +169,11 @@ class AgentGoalWorkflow:
# if we have all needed arguments (handled above) and not holding for a debugging confirm, proceed:
else:
self.confirmed = True
-
- # else if the next step is to pick a new goal, set the goal and tool to do it
+ # else if the next step is to pick a new goal, set that to be the goal
elif next_step == "pick-new-goal":
- if self.goal.id != "goal_choose_agent_type":
- self.add_message("agent", tool_data)
- workflow.logger.info("All tools completed and new Agent Goal recommended. Resetting goal.")
- self.change_goal("goal_choose_agent_type")
- next_step = tool_data["next"] = "confirm"
- current_tool = tool_data["tool"] = "ListAgents"
- waiting_for_confirm = True
- 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
- continue
- else:
- if not current_tool == "ListAgents":
- current_tool = tool_data["tool"] = "ListAgents"
- waiting_for_confirm = True
-
- self.tool_data = tool_data
- next_step = tool_data["next"] = "confirm"
- 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
+ workflow.logger.info("All steps completed. Resetting goal.")
+ self.change_goal("goal_choose_agent_type")
+
# else if the next step is to be done with the conversation such as if the user requests it via asking to "end conversation"