node-chatgpt-api icon indicating copy to clipboard operation
node-chatgpt-api copied to clipboard

Connection Error When Using Bing API

Open KevinKWZheng opened this issue 2 years ago • 3 comments

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

KevinKWZheng avatar Feb 15 '23 06:02 KevinKWZheng

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

waylaidwanderer avatar Feb 15 '23 06:02 waylaidwanderer

Already verified, nothing wrong with Bing in browser

KevinKWZheng avatar Feb 15 '23 07:02 KevinKWZheng

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

waylaidwanderer avatar Feb 15 '23 07:02 waylaidwanderer

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

waylaidwanderer avatar Feb 16 '23 00:02 waylaidwanderer

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

KevinKWZheng avatar Feb 16 '23 01:02 KevinKWZheng