使用gpt4o模型,tool的入参为空时会报错
- Dominant language
- Go
- Stars
- 13k
- Forks
- 1.1k
- Avg merge
- 4h 6m
- Merged PRs (30d)
- 41
Description
**Describe the bug**
MCP工具没有入参时,发起gpt4o的LLM调用时,请求数据为:
```
{
"model": "gpt4o",
"messages": [
{
"role": "user",
"content": [
{
"type": "text",
"text": "温度是多少?"
}
]
}
],
"tools": [
{
"type": "function",
"function": {
"name": "get_current_weather",
"description": "获取当前气温",
"parameters": {
"type": "object"
}
}
}
]
}
```
LLM响应如下错误:
```
{
"error": {
"message": "Invalid schema for function 'get_current_weather': In context=(), object schema missing properties.",
"type": "invalid_request_error",
"param": "tools[0].function.parameters",
"code": "invalid_function_parameters"
}
}
```
是否可以兼容处理下请求数据
Contributor guide
Assessment
This issue has not been assessed yet.