cloudwego / cloudwego/eino

使用gpt4o模型,tool的入参为空时会报错

Open
#384 4 comments 0 reactions 0 assignees View on GitHub
C-bug D-MCP
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.