waylaidwanderer / node-chatgpt-api

A client implementation for ChatGPT and Bing AI. Available as a Node.js module, REST API server, and CLI app.
https://www.npmjs.com/package/@waylaidwanderer/chatgpt-api
MIT License
4.2k stars 738 forks source link

Connection Error When Using Bing API #78

Closed KevinKWZheng closed 1 year ago

KevinKWZheng commented 1 year ago

I am trying the new Bing API, but I always get an error with "connection closed with an error". It doesn't state the reason for the error. this is the output in debug mode:

handshake established
{"arguments":[{"source":"cib","optionsSets":["nlu_direct_response_filter","deepleo","enable_debug_commands","disable_emoji_spoken_text","responsible_ai_policy_235","enablemm"],"isStartOfSession":false,"message":{"author":"user","inputMethod":"Keyboard","text":"Good day","messageType":"Chat"},"conversationSignature":"0bLpYvMO/V7q6Pw3C9ALpRYC4rWG41fxBvIKWY+QmP8=","participant":{"id":"1055518634470050"},"conversationId":"51D|BingProd|718956C04BB1AC67A56677277BF19F88909DEE6D9B47405EAB983DC22B709B15"}],"invocationId":"","target":"chat","type":4}
[{"type":7,"error":"Connection closed with an error.","allowReconnect":true}]
disconnected
waylaidwanderer commented 1 year ago

Are there any issues when you talk to Bing in the browser? Can you go there now and try it?

KevinKWZheng commented 1 year ago

Already verified, nothing wrong with Bing in browser

waylaidwanderer commented 1 year ago

Hmm, hard to say what the issue is without having access to your account, unfortunately.

waylaidwanderer commented 1 year ago

@KevinKaiwenZheng I've made some fixes, can you update to the latest version and see if it's still happening?

KevinKWZheng commented 1 year ago

Resolved, I think it was because I need to leave the conversation options blank, simply passing a null or object of empty strings may invoke some error (missing invocationId I presume) Thanks a lot for your work! @waylaidwanderer