OpenAI SDK接口调用: Function Calling 的 parameters参数和OpenAI 标准不统一 。导致第三方agent库(如:langchain)调用出错。希望能修复一下。
tools = [
{
"type": "function",
"function": {
"name": "get_weather",
"description": "获得天气信息",
# "parameters": {
# "type": "object",
# "properties": {
# "location": {
# "type": "string",
# "description": "要获得天气的地点"
# }
# },
# "required":[
# "location"
# ]
# }
# parameters参数和 OpenAI 标准有点差异:MiniMax:参数这里接收的是字符串, OpenAI 接收的是对象。
"parameters":json.dumps({
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "要获得天气的地点"
}
},
"required":[
"location"
]
})
}
}
]
This is expected. Deepseek v3 has similar issues. You could check ChatMCP or Cline for mitigations.
https://github.com/SecretiveShell/MCP-Bridge/issues/23#issuecomment-2609507094
You can also patch LiteLLM before the officials.
這問題我也遇到 真是麻煩 不知道何時才能解決
This is expected. Deepseek v3 has similar issues. You could check ChatMCP or Cline for mitigations.
SecretiveShell/MCP-Bridge#23 (comment)
You can also patch LiteLLM before the officials.
乱说了。Deepseek v3、kimi等用过的大模型,function定义中parameters接收的是object,就是从v3切换到minimax才发现这个问题。
感谢反馈,我们正在处理中。 Thank you for your feedback. We are currently addressing the issue.
已解决,请重试。 Resolved, please try again