acheong08 / EdgeGPT

Reverse engineered API of Microsoft's Bing Chat AI
The Unlicense
8.07k stars 909 forks source link

[Bug]: Invalid Captcha Response #633

Open SelimWaly opened 1 year ago

SelimWaly commented 1 year ago

Is there an existing issue for this?

What happened?

User needs to solve CAPTCHA to continue

I used to have a running script that used to work but now no longer works:

from EdgeGPT import Chatbot, ConversationStyle

bot = Chatbot(cookiePath='./cookies.json')
response = await bot.ask(prompt=prompt, conversation_style=ConversationStyle.balanced)
            for message in response["item"]["messages"]:
                if message["author"] == "bot":
                    bot_response = message["text"]
            bot_response = re.sub('\[\^\d+\^\]', '', bot_response)
            print("Bot: " + bot_response)

Now I updated my function and I get the response "User needs to solve CAPTCHA challenge" which I am unable to solve through a Python script:

import asyncio, json
from EdgeGPT.EdgeGPT import Chatbot, ConversationStyle

async def main():
    bot = await Chatbot.create() # Passing cookies is "optional", as explained above
    response = await bot.ask(prompt="Hello world", conversation_style=ConversationStyle.creative, simplify_response=True)
    print(json.dumps(response, indent=2)) # Returns
    """
{
    "text": str,
    "author": str,
    "sources": list[dict],
    "sources_text": str,
    "suggestions": list[str],
    "messages_left": int
}
    """
    await bot.close()

if __name__ == "__main__":
    asyncio.run(main())

Steps to reproduce the problem

Not exactly sure.

What should have happened?

The Bing AI response should have been printed into the console.

Version where the problem happens

Latest version (0.12.1)

What Python version are you running this with?

3.10.10

What is your operating system ?

Windows

Command Line Arguments

No

Console logs

Traceback (most recent call last):
  File "d:\GPT Prompt Analysis\3.py", line 21, in <module>
    asyncio.run(main())
  File "C:\Users\CM\AppData\Local\Programs\Python\Python310\lib\asyncio\runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "C:\Users\CM\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 649, in run_until_complete
    return future.result()
  File "d:\GPT Prompt Analysis\3.py", line 6, in main
    response = await bot.ask(prompt="Hello world", conversation_style=ConversationStyle.creative, simplify_response=True)
  File "C:\Users\CM\AppData\Local\Programs\Python\Python310\lib\site-packages\EdgeGPT\EdgeGPT.py", line 116, in ask
    async for final, response in self.chat_hub.ask_stream(
  File "C:\Users\CM\AppData\Local\Programs\Python\Python310\lib\site-packages\EdgeGPT\chathub.py", line 203, in ask_stream
    raise Exception(
Exception: CaptchaChallenge: User needs to solve CAPTCHA to continue.

Additional information

No response

Seminko commented 1 year ago

Same issue here. Captcha all the time.

AlriAlri commented 1 year ago

Using a new set of cookies worked for me (but the Captcha issue reapear, if i use the chat too frequently, then a wait is neccessery).

SelimWaly commented 1 year ago

I used to run it before as much as I want without any time waits.

AzenKain commented 1 year ago

I have the same problem with the captcha, captcha anywhere