Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: unexpected HTTP error createConversation 503: Service Unavailable #39

Open
RaschidJFR opened this issue Jun 15, 2023 · 0 comments

Comments

@RaschidJFR
Copy link

When trying to run any of the demos I get this error:

(base) raschidjfr@MacBook-Pro-de-Raschid bing-chat % npx tsx demos/demo
✖ What are today’s top stories in the United States?
Error: unexpected HTTP error createConversation 503: Service Unavailable
    at <anonymous> (/Users/raschidjfr/Documents/git/bing-chat/src/bing-chat.ts:317:15)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at BingChat.sendMessage (/Users/raschidjfr/Documents/git/bing-chat/src/bing-chat.ts:65:28)
    at async oraPromise (file:///Users/raschidjfr/Documents/git/bing-chat/node_modules/ora/index.js:397:18)
    at main (/Users/raschidjfr/Documents/git/bing-chat/demos/demo.ts:20:15)

The error is traced back to this block. Removing the cookie from the headers seems to fix the problem:

return fetch('https://www.bing.com/turing/conversation/create', {
      headers: {
        accept: 'application/json',
        'accept-language': 'en-US,en;q=0.9',
        'content-type': 'application/json',
        'sec-ch-ua':
          '"Not_A Brand";v="99", "Microsoft Edge";v="109", "Chromium";v="109"',
        'sec-ch-ua-arch': '"x86"',
        'sec-ch-ua-bitness': '"64"',
        'sec-ch-ua-full-version': '"109.0.1518.78"',
        'sec-ch-ua-full-version-list':
          '"Not_A Brand";v="99.0.0.0", "Microsoft Edge";v="109.0.1518.78", "Chromium";v="109.0.5414.120"',
        'sec-ch-ua-mobile': '?0',
        'sec-ch-ua-model': '',
        'sec-ch-ua-platform': '"macOS"',
        'sec-ch-ua-platform-version': '"12.6.0"',
        'sec-fetch-dest': 'empty',
        'sec-fetch-mode': 'cors',
        'sec-fetch-site': 'same-origin',
        'x-edge-shopping-flag': '1',
        'x-ms-client-request-id': requestId,
        'x-ms-useragent':
          'azsdk-js-api-client-factory/1.0.0-beta.1 core-rest-pipeline/1.10.0 OS/MacIntel',
        // cookie    <- Removing this line fixes the problem
      },
      referrer: 'https://www.bing.com/search',
      referrerPolicy: 'origin-when-cross-origin',
      body: null,
      method: 'GET',
      mode: 'cors',
      credentials: 'include'
    })
RaschidJFR added a commit to RaschidJFR/bing-chat that referenced this issue Jun 15, 2023
RaschidJFR added a commit to RaschidJFR/bing-chat that referenced this issue Jun 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant