Issue when using Groq as model and using it with Tools #4922
Unanswered
Akash-kansal
asked this question in
Q&A
Replies: 1 comment
-
|
Hi @Akash-kansal, thanks for reaching out and supporting Agno! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Faced this issue multiple times ERROR Error calling Groq API: Error code: 400 - {'error': {'message': "'messages.3' : for 'role:tool' the following must be satisfied[('messages.3.content' : one
of the following must be satisfied[('messages.3.content' : value must be a string) OR ('messages.3.content.0' : one of the following must be
satisfied[('messages.3.content.0' : value must be an object) OR ('messages.3.content.0' : value must be an object)])])]", 'type': 'invalid_request_error'}}
Error in RAG Orchestrator: {"error":{"message":"'messages.3' : for 'role:tool' the following must be satisfied[('messages.3.content' : one of the following must besatisfied[('messages.3.content' : value must be a string) OR ('messages.3.content.0' : one of the following must be satisfied[('messages.3.content.0' : value must be an object) OR ('messages.3.content.0' : value must be an object)])])]","type":"invalid_request_error"}}
Traceback (most recent call last):
File "/usr/local/lib/python3.10/dist-packages/agno/models/groq/groq.py", line 311, in ainvoke
response = await self.get_async_client().chat.completions.create(
File "/usr/local/lib/python3.10/dist-packages/groq/resources/chat/completions.py", line 771, in create
return await self._post(
File "/usr/local/lib/python3.10/dist-packages/groq/_base_client.py", line 1762, in post
return await self.request(cast_to, opts, stream=stream, stream_cls=stream_cls)
File "/usr/local/lib/python3.10/dist-packages/groq/_base_client.py", line 1576, in request
raise self._make_status_error_from_response(err.response) from None
groq.BadRequestError: Error code: 400 - {'error': {'message': "'messages.3' : for 'role:tool' the following must be satisfied[('messages.3.content' : one of the following must be satisfied[('messages.3.content' : value must be a string) OR ('messages.3.content.0' : one of the following must be satisfied[('messages.3.content.0' : value must be an object) OR ('messages.3.content.0' : value must be an object)])])]", 'type': 'invalid_request_error'}}
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/var/snap/amazon-ssm-agent/11797/github/source/orchestrator.py", line 257, in get_rag_answer
response = await agent_team.arun(question, user_id=self.user_id, session_id=self.session_key, files=session_files, images=session_images)
File "/usr/local/lib/python3.10/dist-packages/agno/team/team.py", line 1412, in _arun
model_response = await self.model.aresponse(
File "/usr/local/lib/python3.10/dist-packages/agno/models/base.py", line 390, in aresponse
async for function_call_response in self.arun_function_calls(
File "/usr/local/lib/python3.10/dist-packages/agno/models/base.py", line 1623, in arun_function_calls
async for item in function_call.result:
File "/usr/local/lib/python3.10/dist-packages/agno/team/team.py", line 5811, in adelegate_task_to_members
results = await asyncio.gather(*[task() for task in tasks]) # type: ignore
File "/usr/local/lib/python3.10/dist-packages/agno/team/team.py", line 5759, in run_member_agent
member_agent_run_response = await agent.arun(
File "/usr/local/lib/python3.10/dist-packages/agno/agent/agent.py", line 1356, in _arun
model_response: ModelResponse = await self.model.aresponse(
File "/usr/local/lib/python3.10/dist-packages/agno/models/base.py", line 363, in aresponse
await self._aprocess_model_response(
File "/usr/local/lib/python3.10/dist-packages/agno/models/base.py", line 554, in _aprocess_model_response
provider_response = await self.ainvoke(
File "/usr/local/lib/python3.10/dist-packages/agno/models/groq/groq.py", line 324, in ainvoke
raise ModelProviderError(
agno.exceptions.ModelProviderError: {"error":{"message":"'messages.3' : for 'role:tool' the following must be satisfied[('messages.3.content' : one of the following must be satisfied[('messages.3.content' : value must be a string) OR ('messages.3.content.0' : one of the following must be satisfied[('messages.3.content.0' : value must be an object) OR ('messages.3.content.0' : value must be an object)])])]","type":"invalid_request_error"}}.
orchestrator.py
factories.py
Beta Was this translation helpful? Give feedback.
All reactions