acheong08 / EdgeGPT

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

[Bug]: #579

Closed renqabs closed 1 year ago

renqabs commented 1 year ago

Is there an existing issue for this?

What happened?

ChatHub.py中class ChatHub的ask_stream方法,当raw=true时不会执行ImageGenAsync函数(即无法画图),也不处理response.get("type") == 6和response.get("type") == 7的消息 image

Steps to reproduce the problem

1、使用ChatHub.ask_stream函数时指定raw=true 2、使用cookie也无法绘画 3、回复的消息过长时,提示连接已断开

What should have happened?

正确处理绘画请求以及response.get("type") == 6和response.get("type") == 7的消息

Version where the problem happens

0.11.6

What Python version are you running this with?

3.10

What is your operating system ?

Linux

Command Line Arguments

No

Console logs

"Traceback (most recent call last):\n  File \"/app/main.py\", line 24, in sydney_process_message\n    async for _, response in chatbot.ask_stream(prompt=user_message, conversation_style=\"creative\",raw=True,\n  File \"/usr/local/lib/python3.11/site-packages/SydneyGPT/SydneyGPT.py\", line 30, in ask_stream\n    async for key, value in super().ask_stream(*args, **kwargs):\n  File \"/usr/local/lib/python3.11/site-packages/EdgeGPT/EdgeGPT.py\", line 181, in ask_stream\n    async for response in self.chat_hub.ask_stream(\n  File \"/usr/local/lib/python3.11/site-packages/SydneyGPT/SydneyGPT.py\", line 55, in ask_stream\n    async for key, value in super().ask_stream(*args, **kwargs):\n  File \"/usr/local/lib/python3.11/site-packages/EdgeGPT/chathub.py\", line 128, in ask_stream\n    msg = await wss.recv()\n          ^^^^^^^^^^^^^^^^\n  File \"/usr/local/lib/python3.11/site-packages/websockets/legacy/protocol.py\", line 568, in recv\n    await self.ensure_open()\n  File \"/usr/local/lib/python3.11/site-packages/websockets/legacy/protocol.py\", line 944, in ensure_open\n    raise self.connection_closed_exc()\nwebsockets.exceptions.ConnectionClosedOK: received 1000 (OK); then sent 1000 (OK)\n"

Additional information

No response