EdgeGPT
EdgeGPT copied to clipboard
[Bug]: websockets.exceptions.InvalidStatusCode: server rejected WebSocket connection: HTTP 200
Is there an existing issue for this?
- [X] I have searched the existing issues and checked the recent builds/commits
What happened?
拷贝rm文档中例子,运行报错,求高人指点。
开启proxy代理后,详细报错如下
File "/Users/naiqing.lnq/source/aigc/tmg-aigc/langchian-start/newbing/test.py", line 18, in
Steps to reproduce the problem
- Go to ....
- Press ....
- ...
What should have happened?
Version where the problem happens
0.12.1 版本
What Python version are you running this with?
3.11.4
What is your operating system ?
MacOS
Command Line Arguments
File "/Users/naiqing.lnq/source/aigc/tmg-aigc/langchian-start/newbing/test.py", line 18, in <module>
asyncio.run(main())
File "/Users/naiqing.lnq/anaconda3/envs/edgeChat/lib/python3.11/asyncio/runners.py", line 190, in run
return runner.run(main)
^^^^^^^^^^^^^^^^
File "/Users/naiqing.lnq/anaconda3/envs/edgeChat/lib/python3.11/asyncio/runners.py", line 118, in run
return self._loop.run_until_complete(task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/naiqing.lnq/anaconda3/envs/edgeChat/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "/Users/naiqing.lnq/source/aigc/tmg-aigc/langchian-start/newbing/test.py", line 12, in main
response = await bot.ask(prompt="Hello world", conversation_style=ConversationStyle.creative)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/naiqing.lnq/anaconda3/envs/edgeChat/lib/python3.11/site-packages/EdgeGPT/EdgeGPT.py", line 116, in ask
async for final, response in self.chat_hub.ask_stream(
File "/Users/naiqing.lnq/anaconda3/envs/edgeChat/lib/python3.11/site-packages/EdgeGPT/chathub.py", line 102, in ask_stream
async with connect(
File "/Users/naiqing.lnq/anaconda3/envs/edgeChat/lib/python3.11/site-packages/websockets/legacy/client.py", line 637, in __aenter__
return await self
^^^^^^^^^^
File "/Users/naiqing.lnq/anaconda3/envs/edgeChat/lib/python3.11/site-packages/websockets/legacy/client.py", line 655, in __await_impl_timeout__
return await self.__await_impl__()
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/naiqing.lnq/anaconda3/envs/edgeChat/lib/python3.11/site-packages/websockets/legacy/client.py", line 662, in __await_impl__
await protocol.handshake(
File "/Users/naiqing.lnq/anaconda3/envs/edgeChat/lib/python3.11/site-packages/websockets/legacy/client.py", line 329, in handshake
raise InvalidStatusCode(status_code, response_headers)
websockets.exceptions.InvalidStatusCode: server rejected WebSocket connection: HTTP 200
Console logs
File "/Users/naiqing.lnq/source/aigc/tmg-aigc/langchian-start/newbing/test.py", line 18, in <module>
asyncio.run(main())
File "/Users/naiqing.lnq/anaconda3/envs/edgeChat/lib/python3.11/asyncio/runners.py", line 190, in run
return runner.run(main)
^^^^^^^^^^^^^^^^
File "/Users/naiqing.lnq/anaconda3/envs/edgeChat/lib/python3.11/asyncio/runners.py", line 118, in run
return self._loop.run_until_complete(task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/naiqing.lnq/anaconda3/envs/edgeChat/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "/Users/naiqing.lnq/source/aigc/tmg-aigc/langchian-start/newbing/test.py", line 12, in main
response = await bot.ask(prompt="Hello world", conversation_style=ConversationStyle.creative)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/naiqing.lnq/anaconda3/envs/edgeChat/lib/python3.11/site-packages/EdgeGPT/EdgeGPT.py", line 116, in ask
async for final, response in self.chat_hub.ask_stream(
File "/Users/naiqing.lnq/anaconda3/envs/edgeChat/lib/python3.11/site-packages/EdgeGPT/chathub.py", line 102, in ask_stream
async with connect(
File "/Users/naiqing.lnq/anaconda3/envs/edgeChat/lib/python3.11/site-packages/websockets/legacy/client.py", line 637, in __aenter__
return await self
^^^^^^^^^^
File "/Users/naiqing.lnq/anaconda3/envs/edgeChat/lib/python3.11/site-packages/websockets/legacy/client.py", line 655, in __await_impl_timeout__
return await self.__await_impl__()
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/naiqing.lnq/anaconda3/envs/edgeChat/lib/python3.11/site-packages/websockets/legacy/client.py", line 662, in __await_impl__
await protocol.handshake(
File "/Users/naiqing.lnq/anaconda3/envs/edgeChat/lib/python3.11/site-packages/websockets/legacy/client.py", line 329, in handshake
raise InvalidStatusCode(status_code, response_headers)
websockets.exceptions.InvalidStatusCode: server rejected WebSocket connection: HTTP 200
Additional information
1