You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Simple examples of tool use with Gemini and DeepSeek fail:
In the example cookbook agents_with_tools if I use the below 2 model configurations, the agent.step call will fail:
fromcamel.configsimportChatGPTConfig, DeepSeekConfig, GeminiConfigtools_list= [
*MathToolkit().get_tools(),
*SearchToolkit().get_tools(),
]
#model for gemini model=ModelFactory.create(
model_platform=ModelPlatformType.GEMINI,
model_type='gemini-1.5-flash',
model_config_dict=GeminiConfig(temperature=0.2, max_tokens=8190).as_dict(),
)
#model for deepseekmodel=ModelFactory.create(
model_platform=ModelPlatformType.DEEPSEEK,
model_type=ModelType.DEEPSEEK_CHAT,
model_config_dict=DeepSeekConfig(temperature=1.3, tools=tools_list).as_dict(),
api_key="sk-xx",
url="https://api.deepseek.com",
)
#Set message for the assistantassistant_sys_msg="""You are a helpful assistant to do search task."""#Set the agentagent=ChatAgent(
assistant_sys_msg,
model=model,
tools=tools_list
)
agent.step('a message that calls tools')
for deepseek I get below error:
File "/opt/miniconda3/lib/python3.12/site-packages/openai/_base_client.py", line 1061, in _request
raise self._make_status_error_from_response(err.response) from None
openai.UnprocessableEntityError: Failed to deserialize the JSON body into the target type: messages[4].role: unknown variant function, expected one of system, user, assistant, tool at line 1 column 19571
for gemini I get below error:
File "/opt/miniconda3/lib/python3.12/site-packages/openai/_base_client.py", line 1061, in _request
raise self._make_status_error_from_response(err.response) from None
openai.BadRequestError: Error code: 400 - [{'error': {'code': 400, 'message': 'Request contains an invalid argument.', 'status': 'INVALID_ARGUMENT'}}]
The text was updated successfully, but these errors were encountered:
Hey @Rahul-Sindhu , thanks for raising this question and sorry for the late reply, for gemini and deepseek, the tool calling support haven't been added into camel, one related issue here: #1238, but we would update support tool calling for this 2 models in this week and will let you know once it's done
Required prerequisites
Questions
Simple examples of tool use with Gemini and DeepSeek fail:
In the example cookbook agents_with_tools if I use the below 2 model configurations, the agent.step call will fail:
for deepseek I get below error:
File "/opt/miniconda3/lib/python3.12/site-packages/openai/_base_client.py", line 1061, in _request
raise self._make_status_error_from_response(err.response) from None
openai.UnprocessableEntityError: Failed to deserialize the JSON body into the target type: messages[4].role: unknown variant
function
, expected one ofsystem
,user
,assistant
,tool
at line 1 column 19571for gemini I get below error:
File "/opt/miniconda3/lib/python3.12/site-packages/openai/_base_client.py", line 1061, in _request
raise self._make_status_error_from_response(err.response) from None
openai.BadRequestError: Error code: 400 - [{'error': {'code': 400, 'message': 'Request contains an invalid argument.', 'status': 'INVALID_ARGUMENT'}}]
The text was updated successfully, but these errors were encountered: