wip checkin

This commit is contained in:
Joshua Smith
2025-04-11 17:43:34 -04:00
parent 585791e826
commit 5b58f30e0d
7 changed files with 81 additions and 8 deletions

View File

@@ -16,6 +16,7 @@ from .hr.checkpaybankstatus import checkpaybankstatus
from .fin.check_account_valid import check_account_valid
from .fin.get_account_balances import get_account_balance
from .fin.move_money import move_money
from .fin.submit_loan_application import submit_loan_application
from .give_hint import give_hint
from .guess_location import guess_location
@@ -53,7 +54,9 @@ def get_handler(tool_name: str):
if tool_name == "FinCheckAccountBalance":
return get_account_balance
if tool_name == "FinMoveMoneyOrder":
return move_money
return move_money
if tool_name == "FinCheckAccountSubmitLoanApproval":
return submit_loan_application
if tool_name == "GiveHint":
return give_hint
if tool_name == "GuessLocation":

View File

@@ -31,7 +31,6 @@ class MoneyMovementWorkflowParameterObj:
# this assumes it's a valid account - use check_account_valid() to verify that first
async def move_money(args: dict) -> dict:
print("in move_money")
account_key = args.get("accountkey")
account_type: str = args.get("accounttype")
amount = args.get("amount")

View File

@@ -302,6 +302,7 @@ goal_fin_check_account_balances = AgentGoal(
)
# this tool checks account balances, and uses ./data/customer_account_data.json as dummy data
# it also uses a separate workflow/tool, see ./setup.md for details
goal_fin_move_money = AgentGoal(
id = "goal_fin_move_money",
category_tag="fin",
@@ -319,7 +320,7 @@ goal_fin_move_money = AgentGoal(
starter_prompt=starter_prompt_generic,
example_conversation_history="\n ".join(
[
"user: I'd like transfer some money",
"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_confirmed_tool_run: <user clicks confirm on FincheckAccountIsValid tool>",
@@ -340,6 +341,37 @@ goal_fin_move_money = AgentGoal(
),
)
# this starts a loan approval process
# it also uses a separate workflow/tool, see ./setup.md for details #todo
goal_fin_loan_application = AgentGoal(
id = "goal_fin_loan_application",
category_tag="fin",
agent_name="Loan Application",
agent_friendly_description="Initiate loan application.",
tools=[
tool_registry.financial_check_account_is_valid,
tool_registry.financial_submit_loan_approval, #todo
],
description="The user wants to apply for a loan at the financial institution. To assist with that goal, help the user gather args for these tools in order: "
"1. FinCheckAccountIsValid: validate the user's account is valid"
"2. FinCheckAccountSubmitLoanApproval: submit the loan for approval",
starter_prompt=starter_prompt_generic,
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?",
"user: account number is 11235813",
"user_confirmed_tool_run: <user clicks confirm on FincheckAccountIsValid tool>",
"tool_result: { 'status': account valid }",
"agent: Great! We've validated your account. What will the loan amount be?",
"user: I'd like a loan for $500",
"user_confirmed_tool_run: <user clicks confirm on FinCheckAccountSubmitLoanApproval tool>",
"tool_result: { 'status': submitted, 'detailed_status': loan application is submitted and initial validation is complete, 'confirmation id': 333421, 'next_step': You'll receive a confirmation for final approval in three business days }",
"agent: I have submitted your loan application process and the initial validation is successful. You'll receive a confirmation from us in three business days. "
]
),
)
#Add the goals to a list for more generic processing, like listing available agents
goal_list: List[AgentGoal] = []
goal_list.append(goal_choose_agent_type)
@@ -351,6 +383,7 @@ goal_list.append(goal_hr_check_pto)
goal_list.append(goal_hr_check_paycheck_bank_integration_status)
goal_list.append(goal_fin_check_account_balances)
goal_list.append(goal_fin_move_money)
goal_list.append(goal_fin_loan_application)

View File

@@ -316,4 +316,23 @@ financial_move_money = ToolDefinition(
description="account number to move the money to",
),
],
)
financial_move_money = ToolDefinition(
name="FinCheckAccountSubmitLoanApproval",
description="Submit a loan application. "
"Returns the loan status. ",
arguments=[
ToolArgument(
name="accountkey",
type="string",
description="email address or account ID of user",
),
ToolArgument(
name="amount",
type="string",
description="amount requested for the loan",
),
],
)