Closed regstuff closed 10 months ago
Hi @regstuff
Thank you for raising this issue. Unfortunately, it seems that I cannot reproduce this issue on my setup. Before you got the cookies, did you make sure to write a message to Bing Chat on the browser itself? Sometimes, it is necessary to do that before you can actually use the cookies. Also, make sure you're using the cookies from edgeservices.bing.com
.
Yes I followed the procedure to get the cookie. It is from edgeservices.bing.com and I am taking it after I write a message. Tried with a different Edge profile and also on a different laptop. But no luck. This is the code I'm using. Do you see anything wrong here? (Have cut out the cookie details for privacy)
import asyncio, os
from sydney import SydneyClient
os.environ["BING_U_COOKIE"] = "1...A"
async def main():
async with SydneyClient(style="creative") as sydney:
response = await sydney.ask("When was Bing Chat released?", citations=True)
print(response)
if __name__ == "__main__":
asyncio.run(main())
Here's the full error:
Traceback (most recent call last):
File "D:\Code\bingchat\sidney_test.py", line 12, in <module>
asyncio.run(main())
File "C:\Program Files\Python39\lib\asyncio\runners.py", line 44, in run
return loop.run_until_complete(main)
File "C:\Program Files\Python39\lib\asyncio\base_events.py", line 647, in run_until_complete
return future.result()
File "D:\Code\bingchat\sidney_test.py", line 8, in main
response = await sydney.ask("When was Bing Chat released?", citations=True)
File "D:\Code\bingchat\bingchat\lib\site-packages\sydney\sydney.py", line 459, in ask
async for response, suggested_responses in self._ask(
File "D:\Code\bingchat\bingchat\lib\site-packages\sydney\sydney.py", line 374, in _ask
raise CaptchaChallengeException("Solve CAPTCHA to continue")
sydney.exceptions.CaptchaChallengeException: Solve CAPTCHA to continue
Exception ignored in: <function _ProactorBasePipeTransport.__del__ at 0x00000235DD7B95E0>
Traceback (most recent call last):
File "C:\Program Files\Python39\lib\asyncio\proactor_events.py", line 116, in __del__
self.close()
File "C:\Program Files\Python39\lib\asyncio\proactor_events.py", line 108, in close
self._loop.call_soon(self._call_connection_lost, None)
File "C:\Program Files\Python39\lib\asyncio\base_events.py", line 751, in call_soon
self._check_closed()
File "C:\Program Files\Python39\lib\asyncio\base_events.py", line 515, in _check_closed
raise RuntimeError('Event loop is closed')
RuntimeError: Event loop is closed
Hi @regstuff I tested your code on my laptop and it worked for me. At first I was also receiving the same error, but I got a new cookie and it fixed the problem.
A few of suggestions:
Success!
message from Bing ChatOPTIONAL
). It works in some regions, according to other users.Hi. Tried all of these, but no luck. :( Not sure what you mean by the Success! message from Bing Chat. I take the cookies after sending a message and receiving a reply in the Edge sidebar. Here's a screenshot
You should
It works for me.
By the way, @vsakkas, in my region, I am able to discuss with Bing Chat in private navigation (without U cookie) but when I set up the cookie as optional in the script, it raised a captcha. Do you know how to solve that ?
Hi @IKDH This is something that I am interested in looking at. I am doing some testing using incognito mode to better understand the differences between using the cookie and without. From a first look, indeed, there are some subtle differences in the request payload, so I will investigate to see if that changes anything.
Well, it's a bit weird. One of the differences between using cookies and not using cookies is that when you use Bing Chat in incognito, the sliceIds
field has a bunch of values. But they change every time I open a new browser window and start a conversation... I will focus for now on other parts of the request
@IKDH I am still looking into this, but lately I am getting throttled quite a lot which makes it hard to test anything. Hopefully, I will be able to come up with an MR for this soon :crossed_fingers:
You are getting throttled in Incognito mode ?
Not in incognito, but with cookies (which the test suite uses) which I use often to test things
You can easily link 4+ mails to Microsoft Bing. So when one is getting throttled, you can switch to the other. I think you can do 300 requests per day per account.
That's a good suggestion! I might set up a second account to grab cookies just for the test suite
0.18.0
brings new improvements when it comes to using Sydney.py with cookie, I believe it should fix the Captcha related issues
Hello, I've followed the instructions and even entered a new cookie each time (by logging in and out in the browser), but I still get
raise CaptchaChallengeException("Solve CAPTCHA to continue")
Any way around this?