I’m getting following error while executing team with v1.3.4. It seems there is some issue while executing tool calls.
DEBUG I would like to know about loan offers.
<context>
{
"session_id": "90"
}
</context>
DEBUG ============================================================ assistant =============================================================
DEBUG Tool Calls:
- ID: 'call_al5aC3bvDQB7oyK0AZy0JvBk'
Name: 'transfer_task_to_member'
Arguments: 'member_id: sales-agent, task_description: Please provide information on the available loan offers for the customer.,
expected_output: Details about the loan offers available for the customer, including rates, terms, and any current promotions.'
DEBUG =============================================================== tool ===============================================================
DEBUG Tool call Id: call_al5aC3bvDQB7oyK0AZy0JvBk
DEBUG To provide you with detailed information about the available loan offers including rates, terms, and any current promotions, I'll need the
customer ID. Could you please provide that information?
DEBUG ============================================================ assistant =============================================================
DEBUG Certainly! Could you please provide your customer ID so I can give you detailed information about the available loan offers?
DEBUG =============================================================== user ===============================================================
DEBUG sure, my customer id is 123
<context>
{
"session_id": "90"
}
</context>
DEBUG ============================================================ assistant =============================================================
DEBUG Tool Calls:
- ID: 'call_K6zfmdX8LoINruUcUbzuHOzj'
Name: 'transfer_task_to_member'
Arguments: 'member_id: sales-agent, task_description: The user has provided their customer ID as 123. Please fetch and provide detailed
information about the loan offers available for the customer, including rates, terms, and any current promotions., expected_output: Detailed loan
offers available for customer ID 123, including rates, terms, and any current promotions.'
DEBUG ************************************************************ METRICS *************************************************************
DEBUG * Tokens: input=1552, output=82, total=1634
DEBUG * Prompt tokens details: {'audio_tokens': 0, 'cached_tokens': 1408}
DEBUG * Completion tokens details: {'accepted_prediction_tokens': 0, 'audio_tokens': 0, 'reasoning_tokens': 0, 'rejected_prediction_tokens': 0}
DEBUG * Time: 2.8130s
DEBUG * Tokens per second: 29.1502 tokens/s
DEBUG ************************************************************ METRICS *************************************************************
DEBUG Getting function transfer_task_to_member
DEBUG Running: transfer_task_to_member(member_id=sales-agent, task_description=..., expected_output=...)
DEBUG ****************************************************** Agent ID: sales-agent *******************************************************
DEBUG ***************************************** Session ID: 6e2e0ef4-db89-4fc5-873d-72cdcd462bce *****************************************
DEBUG ************************************** Agent Run Start: d86d5696-9ba5-444e-a83d-769c3e76d53c ***************************************
DEBUG Getting messages from previous runs: 2
DEBUG Adding 2 messages from history
DEBUG ------------------------------------------------------- Azure Response Start -------------------------------------------------------
DEBUG ---------------------------------------------------------- Model: gpt-4o -----------------------------------------------------------
DEBUG ============================================================== system ==============================================================
DEBUG You are a sales assistant for Horizon Finance that engages customers with loan offers and resolve their queries.
<your_goal>
Your goal is to present pre-approved loan offers and assist with general loan-related queries.
</your_goal>
<your_role>
Handle loan related queries and fetching customer data.
</your_role>
<instructions>
You are a sales assistant for Horizon Finance that engages customers with loan offers and resolve their queries with following responsibilities:
- To fetch customer profile data using tool `get_customer_data`.
- To fetch historical credit history of customer using tool `get_historical_credit_history`.
- To compute monthly EMIs for a provided amount, rate of interest and tenure in months using tool `calculate_emi`.
- To offer recommended loan offers based on similar customer using tool `get_recommendation_similar_customers`,
- To send email containing online application link if customer is interested in applying using tool
`send_email_for_online_application_form_link`.
General instructions:
1. You are a friendly sales assistant for Horizon finance.
2. To retrieve any data for customer, you would need customer id from user.
3. If you need any input from user to run tool calls, please ask the customer to provide that information..
4. Please use provided tool calls wherever needed.
</instructions>
1. `send_email_for_online_application_form_link` will update the session state to `pending_on_user`.
You have the capability to retain memories from previous interactions with the user, but have not had any interactions with the user yet.
DEBUG =============================================================== user ===============================================================
DEBUG You are a member of a team of agents. Your goal is to complete the following task:
<task>
Please provide information on the available loan offers for the customer.
</task>
<expected_output>
Details about the loan offers available for the customer, including rates, terms, and any current promotions.
</expected_output>
DEBUG ============================================================ assistant =============================================================
DEBUG To provide you with detailed information about the available loan offers including rates, terms, and any current promotions, I'll need the
customer ID. Could you please provide that information?
DEBUG =============================================================== user ===============================================================
DEBUG You are a member of a team of agents. Your goal is to complete the following task:
<task>
The user has provided their customer ID as 123. Please fetch and provide detailed information about the loan offers available for the customer,
including rates, terms, and any current promotions.
</task>
<expected_output>
Detailed loan offers available for customer ID 123, including rates, terms, and any current promotions.
</expected_output>
<team context>
{"customer_id": "123"}
</team context>
<member interactions>
Member: Sales Agent
Task: Please provide information on the available loan offers for the customer.
Response: To provide you with detailed information about the available loan offers including rates, terms, and any current promotions, I'll need
the customer ID. Could you please provide that information?
</member interactions>
DEBUG ============================================================ assistant =============================================================
DEBUG Tool Calls:
- ID: 'call_8m2xTRgfgQsjisyR4fc8jDmC'
Name: 'get_customer_data'
Arguments: 'customer_id: 123'
- ID: 'call_1YMQZzBmkIIaptP9KljU20cR'
Name: 'get_recommendation_similar_customers'
Arguments: 'customer_id: 123'
DEBUG ************************************************************ METRICS *************************************************************
DEBUG * Tokens: input=977, output=54, total=1031
DEBUG * Prompt tokens details: {'audio_tokens': 0, 'cached_tokens': 0}
DEBUG * Completion tokens details: {'accepted_prediction_tokens': 0, 'audio_tokens': 0, 'reasoning_tokens': 0, 'rejected_prediction_tokens': 0}
DEBUG * Time: 1.0809s
DEBUG * Tokens per second: 49.9585 tokens/s
DEBUG ************************************************************ METRICS *************************************************************
DEBUG Getting function get_customer_data
ERROR Function get_customer_data not found
DEBUG Getting function get_recommendation_similar_customers
ERROR Function get_recommendation_similar_customers not found
ERROR API status error from OpenAI API: Error code: 400 - {'error': {'message': "An assistant message with 'tool_calls' must be followed by tool
messages responding to each 'tool_call_id'. The following tool_call_ids did not have response messages: call_8m2xTRgfgQsjisyR4fc8jDmC,
call_1YMQZzBmkIIaptP9KljU20cR", 'type': 'invalid_request_error', 'param': 'messages.[5].role', 'code': None}}
WARNING Attempt 1/1 failed: An assistant message with 'tool_calls' must be followed by tool messages responding to each 'tool_call_id'. The following
tool_call_ids did not have response messages: call_8m2xTRgfgQsjisyR4fc8jDmC, call_1YMQZzBmkIIaptP9KljU20cR
ERROR Failed after 1 attempts. Last error using AzureOpenAI(gpt-4o)
WARNING Attempt 3/4 failed: An assistant message with 'tool_calls' must be followed by tool messages responding to each 'tool_call_id'. The following
tool_call_ids did not have response messages: call_8m2xTRgfgQsjisyR4fc8jDmC, call_1YMQZzBmkIIaptP9KljU20cR
I’ve provided my code to @dirk over DMs. @Monali Hope it helps in quickly identifying the issue.