","param":"","code":"invalid_request_error"}
错误信息
400: {"message":"The `reasoning_content` in the thinking mode must be passed back to the API.","type":"invalid_request_error","param":"","code":"invalid_request_error"}
AI 解决方案
原文:The `reasoning_content` in the thinking mode must be passed back to the API.
译文:在思考模式中,`reasoning_content`必须被回传给API。
🎯 原因分析
调用支持“思考模式”的API时,若该模式会产生
reasoning_content(推理过程内容),后续请求必须将该内容作为参数回传,当前请求漏传或未正确传递该字段,导致请求无效。💡 解决方案
确保调用接口时,将前序请求生成的
reasoning_content 作为参数传递,示例:const response = await fetch('your_api_url', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
// 其他必要头部,如鉴权信息
},
body: JSON.stringify({
// 必要的业务参数,如模型名、prompt等
reasoning_content: '前序请求返回的推理内容', // 回传推理内容
})
});
🛡️ 预防措施
reasoning_content 等关联字段。