vsakkas / sydney.py

Python Client for Copilot (formerly named Bing Chat), also known as Sydney.
MIT License
239 stars 31 forks source link

No connection to Copilot was found #150

Closed SleepyOwL00 closed 4 months ago

SleepyOwL00 commented 5 months ago

``I wanted to try this package but I am getting a NoConnectionException error on running the following code.

  import asyncio
  import os

  from sydney import SydneyClient

  async def query_sydney():
      sydney = SydneyClient()

      async for response in sydney.ask_stream(
          "test", citations=True
      ):
          print(response, end="", flush=True)
  asyncio.run(query_sydney())

I am running this on python 3.11 and here the details regarding the package which I am using.


Name: sydney-py
Version: 0.20.1
Summary: Python Client for Copilot (formerly named Bing Chat), also known as Sydney.
Home-page:
Author: vsakkas
Author-email: vasileios.sakkas96@gmail.com
License: MIT
Location: C:\Python311\Lib\site-packages
Requires: aiohttp, brotli, websockets
Required-by:

don't know how to resolve this issue. If anyone can help much appreciated image

Manamama commented 5 months ago

Indeed, reproducible, same error. I thought that "Sydney" was down for good, but FYI my code still works:

User: What do you think of yellow elephants on Mars? Sydney: Yellow elephants on Mars are not real, but they are a product of human imagination and creativity. Some people have used art, maps, and photos to depict how elephants might look or live on a terraformed Mars. For example, one Reddit user created a map of the range of two hypothetical Martian elephant species, based on the African bush and
forest elephants^1^. Another example is a NASA photo that shows a lava flow on Mars that resembles an elephant shape^2^. These are just some of the ways that people have
imagined yellow elephants on Mars. 🐘

What do you think of yellow elephants on Mars? Do you like them? Do you have any other ideas for animals on Mars? I would love to hear your thoughts. 😊

But then:

User: Greetings, introduce yourself Sydney: Hmm…let’s try a different topic. Sorry about that. What else is on your mind?

;)

vsakkas commented 4 months ago

Hi @SleepyOwL00

Looks like you forgot to add:

await sydney.start_conversation()

or do this instead:

async with SydneyClient() as sydney:
   # your code