Comments (5)
ChatGPT error 400: {"error":{"code":"json: cannot unmarshal array into Go struct field api_message.messages.content of type string","message":"Request must be proper JSON","param":null,"type":"invalid_request_error"}}
大佬这个咋处理
发现问题了 不支持携带上下文,关闭上下文就正常了
from aurora.
你的messages格式错误了,把请求的json贴一下
from aurora.
你的messages格式错误了,把请求的json贴一下
Apr 04 13:29:57 chatgpt pnpm[8996]: sendMessage (70 tokens) {
Apr 04 13:29:57 chatgpt pnpm[8996]: max_tokens: 1024,
Apr 04 13:29:57 chatgpt pnpm[8996]: model: 'gpt-3.5-turbo',
Apr 04 13:29:57 chatgpt pnpm[8996]: temperature: 0.8,
Apr 04 13:29:57 chatgpt pnpm[8996]: top_p: 1,
Apr 04 13:29:57 chatgpt pnpm[8996]: presence_penalty: 1,
Apr 04 13:29:57 chatgpt pnpm[8996]: messages: [
Apr 04 13:29:57 chatgpt pnpm[8996]: {
Apr 04 13:29:57 chatgpt pnpm[8996]: role: 'system',
Apr 04 13:29:57 chatgpt pnpm[8996]: content: 'You are ChatGPT, a large language model trained by OpenAI. Answer as concisely as possible.\n' +
Apr 04 13:29:57 chatgpt pnpm[8996]: 'Knowledge cutoff: 2021-09-01\n' +
Apr 04 13:29:57 chatgpt pnpm[8996]: 'Current date: 2024-04-04'
Apr 04 13:29:57 chatgpt pnpm[8996]: },
Apr 04 13:29:57 chatgpt pnpm[8996]: { role: 'user', content: [ { type: 'text', text: 'hello' } ] },
Apr 04 13:29:57 chatgpt pnpm[8996]: {
Apr 04 13:29:57 chatgpt pnpm[8996]: role: 'assistant',
Apr 04 13:29:57 chatgpt pnpm[8996]: content: 'Hi there! How can I assist you today?'
Apr 04 13:29:57 chatgpt pnpm[8996]: },
Apr 04 13:29:57 chatgpt pnpm[8996]: { role: 'user', content: 'hello' }
Apr 04 13:29:57 chatgpt pnpm[8996]: ],
Apr 04 13:29:57 chatgpt pnpm[8996]: stream: true
Apr 04 13:29:57 chatgpt pnpm[8996]: }
Apr 04 13:29:57 chatgpt pnpm[8996]: ChatGPTError: ChatGPT error 400: {"error":{"code":"json: cannot unmarshal array into Go struct field api_message.messages.content of type string","message":"Request must be proper JSON","param":null,"type":"invalid_request_error"}}
Apr 04 13:29:57 chatgpt pnpm[8996]: at fetchSSE (/usr/share/nginx/html/service/node_modules/.pnpm/@[email protected]/node_modules/@chatgptweb/chatgpt-api/src/fetch-sse.ts:27:19)
Apr 04 13:29:57 chatgpt pnpm[8996]: at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
Apr 04 13:29:57 chatgpt pnpm[8996]: statusCode: 400,
Apr 04 13:29:57 chatgpt pnpm[8996]: statusText: 'Bad Request',
Apr 04 13:29:57 chatgpt pnpm[8996]: [cause]: Response {
Apr 04 13:29:57 chatgpt pnpm[8996]: [Symbol(realm)]: null,
Apr 04 13:29:57 chatgpt pnpm[8996]: [Symbol(state)]: {
Apr 04 13:29:57 chatgpt pnpm[8996]: aborted: false,
Apr 04 13:29:57 chatgpt pnpm[8996]: rangeRequested: false,
Apr 04 13:29:57 chatgpt pnpm[8996]: timingAllowPassed: true,
Apr 04 13:29:57 chatgpt pnpm[8996]: requestIncludesCredentials: true,
Apr 04 13:29:57 chatgpt pnpm[8996]: type: 'default',
Apr 04 13:29:57 chatgpt pnpm[8996]: status: 400,
Apr 04 13:29:57 chatgpt pnpm[8996]: timingInfo: [Object],
Apr 04 13:29:57 chatgpt pnpm[8996]: cacheState: '',
Apr 04 13:29:57 chatgpt pnpm[8996]: statusText: 'Bad Request',
Apr 04 13:29:57 chatgpt pnpm[8996]: headersList: [HeadersList],
Apr 04 13:29:57 chatgpt pnpm[8996]: urlList: [Array],
Apr 04 13:29:57 chatgpt pnpm[8996]: body: [Object]
Apr 04 13:29:57 chatgpt pnpm[8996]: },
Apr 04 13:29:57 chatgpt pnpm[8996]: [Symbol(headers)]: HeadersList {
Apr 04 13:29:57 chatgpt pnpm[8996]: cookies: null,
Apr 04 13:29:57 chatgpt pnpm[8996]: [Symbol(headers map)]: [Map],
Apr 04 13:29:57 chatgpt pnpm[8996]: [Symbol(headers map sorted)]: null
Apr 04 13:29:57 chatgpt pnpm[8996]: }
Apr 04 13:29:57 chatgpt pnpm[8996]: }
Apr 04 13:29:57 chatgpt pnpm[8996]: }
使用的第三方客户端是 https://github.com/chatgpt-web-dev/chatgpt-web
from aurora.
{ role: 'user', content: [ { type: 'text', text: 'hello' } ] },你这个不是错误了吗? 字符串你传了数组
from aurora.
{ role: 'user', content: [ { type: 'text', text: 'hello' } ] },你这个不是错误了吗? 字符串你传了数组
这个是那个客户端默认就是这样的,不是我去传的;
from aurora.
Related Issues (20)
- 服务很容易被封 HOT 1
- 不维护了吗? HOT 1
- 网关错误或超时,请稍后重试! HOT 2
- 请教大佬,该如何使用
- failed to get chat requirements HOT 4
- “Unusual activity has been detected from your device. Try again later” HOT 8
- TLS handshake timeout HOT 1
- 怎么使用不来了?
- 网关超时是什么原因,是指了 apikey 也一样。 HOT 3
- 请求增加CA证书变量 HOT 1
- 关于群晖nas用docker部署的网络问题 HOT 1
- 我看代码都还在,为啥说闭源了? HOT 1
- failed to get chat requirements HOT 1
- this request does not support noauth HOT 1
- 一些疑问 HOT 1
- Adding support to https://cloud.sealos.io/ as hosting services. HOT 3
- 想问问关于access_token的问题 HOT 6
- 请问一下大佬 HOT 1
- 什么时候支持arm的CPU? HOT 1
- 为什么用了一段时间就不可以了,但是重启docker又正常了 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aurora.