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

Not working anymore. ConversationSignature not returned

Open mrcferri opened this issue 3 years ago • 5 comments

Everything worked smoothly until yesterday. I had a couple of projects running and both stopped working at the same time. A bit of debugging revealed that when creating a new conversation the response doesn't contain a conversationSignature and an exception is thrown (line 203 of BingAIClient.js). Any idea? I suspect something changed on Bing and/or OpenAI side... Thanks, Marco

mrcferri avatar Oct 05 '23 14:10 mrcferri

How did you get this error? How do you debug it? I am semi-new to node and all I get is a timeout error, I'd like to see if our errors are the same. What cookie/token are you using? I saw some metion using other cookies but I have no idea how to go about it;.

harryeffinpotter avatar Oct 05 '23 15:10 harryeffinpotter

Interestingly enough - I got some responses from the bot, but sparingly. https://bin.wizardrysoftwaresolutions.com/u/08rwmz.jpg

harryeffinpotter avatar Oct 05 '23 15:10 harryeffinpotter

@harryeffinpotter To debug I use Visual Studio. It used to work with the user token (_U cookie). On failure I tried also to provide all Bing cookies to no avail. This is the debug output, just before the exception:

{
  conversationId: '51D|BingProd|9DA70F50D679FEE0C91F081A07D7DCCC4ADF946CE04399477F12708686E2AE07',
  clientId: '844426658913453',
  result: { value: 'Success', message: null }
}

As you can see a conversationSignature field is missing and that's what the following code (lines 196-206 of BingAIClient.js) checks before throwing the exception:

if (!createNewConversationResponse.conversationSignature
    || !createNewConversationResponse.conversationId
    || !createNewConversationResponse.clientId) {
    const resultValue = createNewConversationResponse.result?.value;
    if (resultValue) {
        const e = new Error(createNewConversationResponse.result.message); // default e.name is 'Error'
        e.name = resultValue; // such as "UnauthorizedRequest"
        throw e;
    }
    throw new Error(`Unexpected response:\n${JSON.stringify(createNewConversationResponse, null, 2)}`);
}

Strangely enough the result.value says "Success"

mrcferri avatar Oct 05 '23 15:10 mrcferri

Ok, problem solved applying pull request at #481 as suggested in #470.

mrcferri avatar Oct 06 '23 14:10 mrcferri

Please keep this issue open for now as the problem isn't fixed until the PR is merged. Thanks.

waylaidwanderer avatar Oct 06 '23 17:10 waylaidwanderer