labring / FastGPT

FastGPT is a knowledge-based platform built on the LLMs, offers a comprehensive suite of out-of-the-box capabilities such as data processing, RAG retrieval, and visual AI workflow orchestration, letting you easily develop and deploy complex question-answering systems without the need for extensive setup or configuration.
https://tryfastgpt.ai
Other
17.49k stars 4.69k forks source link

对接chatgpt-on-wechat后,对话报错 #1280

Closed cuisws closed 6 months ago

cuisws commented 6 months ago

例行检查

你的版本

问题描述 对接chatgpt-on-wechat聊天时报错,返回的错误信息如下: [CHATGPT] Bad Gateway: Invalid response object from API: '{"code":500,"statusText":"","message":"messages: Unexpected role \"system\". The Messages API accepts a top-level system parameter, not \"system\" as an input message role. (request id: 2024042406551098314045715094124)","data":null}' (HTTP response code was 500) 复现步骤

预期结果

相关截图 这是fastgpt里面的错误信息: { 2024-04-24 14:55:33 message: '400 messages: Unexpected role "system". The Messages API accepts a top-level system parameter, not "system" as an input message role. (request id: 2024042406553358995318792461046)', 2024-04-24 14:55:33 stack: 'Error: 400 messages: Unexpected role "system". The Messages API accepts a top-level system parameter, not "system" as an input message role. (request id: 2024042406553358995318792461046)\n' + 2024-04-24 14:55:33 ' at eI.generate (/app/projects/app/.next/server/chunks/28687.js:25:70043)\n' + 2024-04-24 14:55:33 ' at af.makeStatusError (/app/projects/app/.next/server/chunks/28687.js:25:81687)\n' + 2024-04-24 14:55:33 ' at af.makeRequest (/app/projects/app/.next/server/chunks/28687.js:25:82610)\n' + 2024-04-24 14:55:33 ' at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n' + 2024-04-24 14:55:33 ' at async Object.x [as chatNode] (/app/projects/app/.next/server/chunks/60913.js:129:1124)\n' + 2024-04-24 14:55:33 ' at async $ (/app/projects/app/.next/server/chunks/60913.js:130:2838)\n' + 2024-04-24 14:55:33 ' at async Promise.all (index 0)\n' + 2024-04-24 14:55:33 ' at async Promise.all (index 0)\n' + 2024-04-24 14:55:33 ' at async Promise.all (index 0)\n' + 2024-04-24 14:55:33 ' at async b (/app/projects/app/.next/server/chunks/60913.js:130:4167)\n' + 2024-04-24 14:55:33 ' at async /app/projects/app/.next/server/pages/api/v1/chat/completions.js:1:4238' 2024-04-24 14:55:33 }

cuisws commented 6 months ago

我是本地容器运行,最新版本4.7.1,我看到one api日志显示我对话时请求的是text-embedding-ada-002模型,不知道为什么。这个应用模型设置的是claude,fastgpt对话是正常的。

cuisws commented 6 months ago

解决了,根据报错信息误打误撞试了一下,把chatgpt-on-wechat中的character_desc和subscribe_msg值设置为空字符串。

nianyi778 commented 3 months ago

解决了,根据报错信息误打误撞试了一下,把chatgpt-on-wechat中的character_desc和subscribe_msg值设置为空字符串。

什么原理啊