mirror of
https://github.com/temporal-community/temporal-ai-agent.git
synced 2026-03-16 06:28:08 +01:00
- fixes for multi-goal:post first real goal goal switch: duplicate listagents behavior from the toolplanner
- adding ecommerce initial guidance - fixed new-goal guidance prompts for multi-goal mode - (minor) fixed abug in money movement so it won't connect to temporal cloud if it's not doing a real workflow - (minor) fixed abug in loan application so it won't connect to temporal cloud if it's not doing a real workflow - some todo notes cleanup
This commit is contained in:
@@ -77,8 +77,6 @@ async def move_money(args: dict) -> dict:
|
||||
# Async function to start workflow
|
||||
async def start_workflow(amount_cents: int, from_account_name: str, to_account_name: str)-> str:
|
||||
|
||||
# Connect to Temporal
|
||||
client = await get_temporal_client()
|
||||
start_real_workflow = os.getenv("FIN_START_REAL_WORKFLOW")
|
||||
if start_real_workflow is not None and start_real_workflow.lower() == "false":
|
||||
START_REAL_WORKFLOW = False
|
||||
@@ -86,6 +84,8 @@ async def start_workflow(amount_cents: int, from_account_name: str, to_account_n
|
||||
START_REAL_WORKFLOW = True
|
||||
|
||||
if START_REAL_WORKFLOW:
|
||||
# Connect to Temporal
|
||||
client = await get_temporal_client()
|
||||
# Create the parameter object
|
||||
params = MoneyMovementWorkflowParameterObj(
|
||||
amount=amount_cents,
|
||||
|
||||
@@ -46,14 +46,14 @@ async def submit_loan_application(args: dict) -> dict:
|
||||
# Async function to start workflow
|
||||
async def start_workflow(amount: str, account_name: str, )-> dict:
|
||||
|
||||
# Connect to Temporal
|
||||
client = await get_temporal_client()
|
||||
start_real_workflow = os.getenv("FIN_START_REAL_WORKFLOW")
|
||||
if start_real_workflow is not None and start_real_workflow.lower() == "false":
|
||||
START_REAL_WORKFLOW = False
|
||||
return {'loan_application_status': "applied", 'application_details': "loan application is submitted and initial validation is complete",'transaction_id': "APPLICATION"+account_name, 'advisement': "You'll receive a confirmation for final approval in three business days", }
|
||||
else:
|
||||
START_REAL_WORKFLOW = True
|
||||
# Connect to Temporal
|
||||
client = await get_temporal_client()
|
||||
|
||||
# Define the workflow ID and task queue
|
||||
workflow_id = "LOAN_APPLICATION-"+account_name+"-"+date.today().strftime('%Y-%m-%d')
|
||||
|
||||
@@ -345,7 +345,7 @@ goal_fin_move_money = AgentGoal(
|
||||
)
|
||||
|
||||
# this starts a loan approval process
|
||||
# it also uses a separate workflow/tool, see ./setup.md for details #todo
|
||||
# it also uses a separate workflow/tool, see ./setup.md for details
|
||||
goal_fin_loan_application = AgentGoal(
|
||||
id = "goal_fin_loan_application",
|
||||
category_tag="fin",
|
||||
@@ -353,7 +353,7 @@ goal_fin_loan_application = AgentGoal(
|
||||
agent_friendly_description="Initiate loan application.",
|
||||
tools=[
|
||||
tool_registry.financial_check_account_is_valid,
|
||||
tool_registry.financial_submit_loan_approval, #todo
|
||||
tool_registry.financial_submit_loan_approval,
|
||||
],
|
||||
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"
|
||||
@@ -375,7 +375,6 @@ goal_fin_loan_application = AgentGoal(
|
||||
),
|
||||
)
|
||||
# ----- E-Commerce Goals ---
|
||||
#todo: add goal to list all orders for last X amount of time?
|
||||
# this tool checks account balances, and uses ./data/customer_account_data.json as dummy data
|
||||
goal_ecomm_order_status = AgentGoal(
|
||||
id = "goal_ecomm_order_status",
|
||||
|
||||
Reference in New Issue
Block a user