We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
例行检查
问题描述 错误信息: '<400> InternalError.Algo.InvalidParameter: messages with role "tool" must be a response to a preceeding message with "tool_calls".',
直接调用通义千问的api没问题,调用oneapi报错
复现步骤
import OpenAI from "openai"; const openai = new OpenAI({ // baseURL: 'http://localhost:3001/v1', // 报错 // apiKey: "sk-fastgpt", baseURL: 'https://dashscope.aliyuncs.com/compatible-mode/v1', //没问题 }); const response = await openai.chat.completions.create({ model: 'qwen-turbo', temperature: undefined, max_tokens: Infinity, stream: false, messages: [ { "role": "user", "content": "小明的年龄" }, { "role": "assistant", "content": "", "tool_calls": [ { "id": "oihVoPf6LWRt", "type": "function", "function": { "name": "uVmL4L", "arguments": "{\"username\": \"小明\"}" } } ] }, { tool_call_id: 'oihVoPf6LWRt', role: 'tool', name: 'uVmL4L', content: '{\n "result": {\n "age": 11\n }\n}' } ], tools: [{ type: 'function', function: { "name": "uVmL4L", "description": "Sends a GET request with a username query parameter to retrieve the age.", "parameters": { "type": "object", "properties": { "username": { "type": "string", "description": "The username to look up.", "enum": [] } }, "required": ["username"] } } }], tool_choice: 'auto' } ); console.log(JSON.stringify(response.choices[0].message,'',2));
The text was updated successfully, but these errors were encountered:
我也是这个问题,你是用的0.6几版本
Sorry, something went wrong.
No branches or pull requests
例行检查
问题描述
错误信息:
'<400> InternalError.Algo.InvalidParameter: messages with role "tool" must be a response to a preceeding message with "tool_calls".',
直接调用通义千问的api没问题,调用oneapi报错
复现步骤
The text was updated successfully, but these errors were encountered: