-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Labels
P2Task with low level priorityTask with low level prioritybugSomething isn't workingSomething isn't workingcall for contributiongood first issueGood for newcomersGood for newcomers
Milestone
Description
Required prerequisites
- I have read the documentation https://camel-ai.github.io/camel/camel.html.
- I have searched the Issue Tracker and Discussions that this hasn't already been reported. (+1 or comment there if it has.)
- Consider asking first in a Discussion.
What version of camel are you using?
0.2.43
System information
3.10.0 (default, Mar 3 2022, 09:58:08) [GCC 7.5.0] linux
0.2.43
Problem description
Sometimes the tool calling for the openai model will raise error.
Reproducible example code
The Python snippets:
openai_model = ModelFactory.create(
model_platform=ModelPlatformType.OPENAI,
model_type=ModelType.GPT_4O_MINI,
)Command lines:
Extra dependencies:
Steps to reproduce:
Traceback
2025-04-17 08:38:13,534 - social.agent - ERROR - Agent 9 error: Unable to process messages: none of the provided models run successfully.
2025-04-17 08:38:13,554 - camel.models.model_manager - ERROR - Error processing with model: <camel.models.openai_model.OpenAIModel object at 0x14fa9e9af2b0>
2025-04-17 08:38:13,554 - camel.agents.chat_agent - ERROR - An error occurred while running model gpt-4o-mini, index: 1
Traceback (most recent call last):
File "/ibex/user/yangz0h/miniconda3/envs/oasis-2025/lib/python3.10/site-packages/camel/agents/chat_agent.py", line 839, in _aget_model_response
response = await self.model_backend.arun(
File "/ibex/user/yangz0h/miniconda3/envs/oasis-2025/lib/python3.10/site-packages/camel/models/model_manager.py", line 265, in arun
raise exc
File "/ibex/user/yangz0h/miniconda3/envs/oasis-2025/lib/python3.10/site-packages/camel/models/model_manager.py", line 253, in arun
response = await self.current_model.arun(
File "/ibex/user/yangz0h/miniconda3/envs/oasis-2025/lib/python3.10/site-packages/camel/models/base_model.py", line 307, in arun
return await self._arun(messages, response_format, tools)
File "/ibex/user/yangz0h/miniconda3/envs/oasis-2025/lib/python3.10/site-packages/camel/models/openai_model.py", line 243, in _arun
return await self._arequest_chat_completion(messages, tools)
File "/ibex/user/yangz0h/miniconda3/envs/oasis-2025/lib/python3.10/site-packages/camel/models/openai_model.py", line 279, in _arequest_chat_completion
return await self._async_client.chat.completions.create(
File "/ibex/user/yangz0h/miniconda3/envs/oasis-2025/lib/python3.10/site-packages/openai/resources/chat/completions/completions.py", line 2000, in create
return await self._post(
File "/ibex/user/yangz0h/miniconda3/envs/oasis-2025/lib/python3.10/site-packages/openai/_base_client.py", line 1767, in post
return await self.request(cast_to, opts, stream=stream, stream_cls=stream_cls)
File "/ibex/user/yangz0h/miniconda3/envs/oasis-2025/lib/python3.10/site-packages/openai/_base_client.py", line 1461, in request
return await self._request(
File "/ibex/user/yangz0h/miniconda3/envs/oasis-2025/lib/python3.10/site-packages/openai/_base_client.py", line 1562, in _request
raise self._make_status_error_from_response(err.response) from None
openai.BadRequestError: Error code: 400 - {'error': {'message': "Invalid 'messages[2].tool_calls[0].id': string too long. Expected a string with maximum length 40, but got a string with length 46 instead.", 'type': 'invalid_request_error', 'param': 'messages[2].tool_calls[0].id', 'code': 'string_above_max_length'}}Expected behavior
No response
Additional context
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P2Task with low level priorityTask with low level prioritybugSomething isn't workingSomething isn't workingcall for contributiongood first issueGood for newcomersGood for newcomers
Type
Projects
Status
No status