Open Hk-Gosuto opened 7 months ago
playload
{
"model": "gpt-4",
"temperature": 0.5,
"top_p": 1,
"frequency_penalty": 0,
"presence_penalty": 0,
"n": 1,
"stream": false,
"tools": [
{
"type": "function",
"function": {
"name": "google_search",
"description": "a search engine. useful for when you need to answer questions about current events. input should be a search query.",
"parameters": {
"type": "object",
"properties": {
"input": {
"type": "string"
}
},
"additionalProperties": false,
"$schema": "http://json-schema.org/draft-07/schema#"
}
}
},
{
"type": "function",
"function": {
"name": "calculator",
"description": "Useful for getting the result of a math expression. The input to this tool should be a valid mathematical expression that could be executed by a simple calculator.",
"parameters": {
"type": "object",
"properties": {
"input": {
"type": "string"
}
},
"additionalProperties": false,
"$schema": "http://json-schema.org/draft-07/schema#"
}
}
},
{
"type": "function",
"function": {
"name": "web-browser",
"description": "useful for when you need to find something on or summarize a webpage. input should be a comma separated list of \"ONE valid http URL including protocol\",\"what you want to find on the page or empty string for a summary\".",
"parameters": {
"type": "object",
"properties": {
"input": {
"type": "string"
}
},
"additionalProperties": false,
"$schema": "http://json-schema.org/draft-07/schema#"
}
}
}
],
"messages": [
{
"role": "system",
"content": "\nYou are ChatGPT, a large language model trained by OpenAI.\nKnowledge cutoff: 2021-09\nCurrent model: gpt-4\nCurrent time: 2024/2/22 21:18:27\nLatex inline: $x^2$ \nLatex block: $$e=mc^2$$\n\n"
},
{
"role": "user",
"content": "搜索一下上海明天的天气"
},
{
"role": "assistant",
"content": "",
"tool_calls": [
{
"index": 0,
"id": "call_iBvwBjtYGFvw37FmwtQ5UTKO",
"type": "function",
"function": {
"name": "google_search",
"arguments": "{\n \"input\": \"上海明天的天气\"\n}"
}
}
]
},
{
"role": "tool",
"content": "{\"type\":\"weather_result\",\"temperature\":\"41\",\"unit\":\"Fahrenheit\",\"precipitation\":\"10%\",\"humidity\":\"81%\",\"wind\":\"13 mph\",\"location\":\"上海\",\"date\":\"Friday\",\"weather\":\"Cloudy\"}",
"tool_call_id": "call_iBvwBjtYGFvw37FmwtQ5UTKO"
}
]
}
最终发送到 azure 的请求会缺失 $.messages[3].tool_call_id
好的,周末处理
我也遇到了,和https://github.com/songquanpeng/one-api/issues/784 应该是一个问题
我也遇到了同样的问题
好的,周末处理
@songquanpeng ping一下看看有没有啥进展。另外我看到azure用的是toolCallId而不是tool_call_id。不知道是不是跟这个有关系https://github.com/vercel/ai/issues/1369
我也遇到了同样的问题
这个问题现在有解决嘛?
例行检查
问题描述
使用本项目转发了 azure 服务的 openai 模型,当模型名为
gpt-4
和gpt-4-0613
时,基于tool_call
模式的函数调用会出现以下错误:当模型名为
gpt-4-1106-preview
时则函数调用正常。 API 版本为:2024-02-15-preview
目前看来只有当部署名为gpt-4
和gpt-4-0613
会出现该问题,与实际使用的模型版本无关。复现步骤
在 azure 部署两个 gpt-4 模型,部署名分别为
gpt-4
和gpt-4-1106-preview
,模型版本随意,通过 one-api 配置转发服务并设置 api 版本为2024-02-15-preview
。 使用项目 ChatGPT-Next-Web-LangChain 分别对两个模型出发函数调用。预期结果
正确的函数调用
相关截图