The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File “C:\Users\c-zhaoch04\projects\agno\product_development_team.py”, line 226, in
product_development_team.print_response(user_input)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
File “C:\Users\c-zhaoch04\AppData\Local\anaconda3\envs\agno\Lib\site-packages\agno\team\team.py”, line 1634, in print_response
self._print_response(
~~~~~~~~~~~~~~~~~~~~^
message=message,
^^^^^^^^^^^^^^^^
…<10 lines>…
**kwargs,
^^^^^^^^^
)
^
File “C:\Users\c-zhaoch04\AppData\Local\anaconda3\envs\agno\Lib\site-packages\agno\team\team.py”, line 1699, in _print_response
run_response: TeamRunResponse = self.run( # type: ignore
~~~~~~~~^^^^^^^^^^^^^^^^^
message=message,
^^^^^^^^^^^^^^^^
…<5 lines>…
**kwargs,
^^^^^^^^^
)
^
File “C:\Users\c-zhaoch04\AppData\Local\anaconda3\envs\agno\Lib\site-packages\agno\team\team.py”, line 608, in run
raise last_exception
File “C:\Users\c-zhaoch04\AppData\Local\anaconda3\envs\agno\Lib\site-packages\agno\team\team.py”, line 580, in run
self._run(
~~~~~~~~~^
run_response=self.run_response,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
run_messages=run_messages,
^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File “C:\Users\c-zhaoch04\AppData\Local\anaconda3\envs\agno\Lib\site-packages\agno\team\team.py”, line 645, in _run
model_response = self.model.response(messages=run_messages.messages) # type: ignore
File “C:\Users\c-zhaoch04\AppData\Local\anaconda3\envs\agno\Lib\site-packages\agno\models\base.py”, line 193, in response
for function_call_response in self.run_function_calls(
~~~~~~~~~~~~~~~~~~~~~~~^
function_calls=function_calls_to_run, function_call_results=function_call_results
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
):
^
File “C:\Users\c-zhaoch04\AppData\Local\anaconda3\envs\agno\Lib\site-packages\agno\models\base.py”, line 874, in run_function_calls
for item in fc.result:
^^^^^^^^^
File “C:\Users\c-zhaoch04\AppData\Local\anaconda3\envs\agno\Lib\site-packages\agno\team\team.py”, line 4537, in transfer_task_to_member
member_agent_run_response = member_agent.run(
member_agent_task, images=images, videos=videos, audio=audio, files=files, stream=False
)
File “C:\Users\c-zhaoch04\AppData\Local\anaconda3\envs\agno\Lib\site-packages\agno\agent\agent.py”, line 1019, in run
raise last_exception
File “C:\Users\c-zhaoch04\AppData\Local\anaconda3\envs\agno\Lib\site-packages\agno\agent\agent.py”, line 989, in run
return next(resp)
File “C:\Users\c-zhaoch04\AppData\Local\anaconda3\envs\agno\Lib\site-packages\agno\agent\agent.py”, line 701, in _run
model_response = self.model.response(messages=run_messages.messages)
File “C:\Users\c-zhaoch04\AppData\Local\anaconda3\envs\agno\Lib\site-packages\agno\models\base.py”, line 177, in response
assistant_message, has_tool_calls = self._process_model_response(
~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
messages=messages,
^^^^^^^^^^^^^^^^^^
model_response=model_response,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File “C:\Users\c-zhaoch04\AppData\Local\anaconda3\envs\agno\Lib\site-packages\agno\models\base.py”, line 313, in _process_model_response
response = self.invoke(messages=messages)
File “C:\Users\c-zhaoch04\AppData\Local\anaconda3\envs\agno\Lib\site-packages\agno\models\openai\chat.py”, line 355, in invoke
raise ModelProviderError(
…<4 lines>…
) from e
agno.exceptions.ModelProviderError: 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_zRyQIEKHvbG6Z4aVddwkTk5q
The problem didn’t appear every time. I didn’t change anything but the exceptions occured sometimes.