Harry-Jing / nonebot-plugin-bing-chat

一个可以使用新版Bing进行聊天的NoneBot插件
GNU General Public License v3.0
168 stars 12 forks source link

websockets.exceptions.InvalidStatusCode: server rejected WebSocket connection: HTTP 200 #77

Open Amber-siley opened 1 year ago

Amber-siley commented 1 year ago
07-04 19:13:13 [SUCCESS] nonebot | OneBot V11 2043349798 | [message.private.friend]: Message -1703396180 from 2767145231 'bing 你好'
07-04 19:13:13 [INFO] nonebot | Event will be handled by Matcher(type='message', module=nonebot_plugin_bing_chat.common)
07-04 19:13:13 [INFO] nonebot | Matcher(type='message', module=nonebot_plugin_bing_chat.common) running complete
07-04 19:13:13 [INFO] nonebot | Event will be handled by Matcher(type='message', module=nonebot_plugin_bing_chat.common)
07-04 19:13:15 [INFO] nonebot | Matcher(type='message', module=nonebot_plugin_bing_chat.common) running complete
07-04 19:13:15 [ERROR] nonebot | Running Matcher(type='message', module=nonebot_plugin_bing_chat.common) failed.
Traceback (most recent call last):
  File "<string>", line 17, in <module>
  File "C:\Users\enjoy\Desktop\bot\bot1\.venv\lib\site-packages\nonebot\__init__.py", line 309, in run
    get_driver().run(*args, **kwargs)
  File "C:\Users\enjoy\Desktop\bot\bot1\.venv\lib\site-packages\nonebot\drivers\fastapi.py", line 198, in run
    uvicorn.run(
  File "C:\Users\enjoy\Desktop\bot\bot1\.venv\lib\site-packages\uvicorn\main.py", line 578, in run
    server.run()
  File "C:\Users\enjoy\Desktop\bot\bot1\.venv\lib\site-packages\uvicorn\server.py", line 61, in run
    return asyncio.run(self.serve(sockets=sockets))
  File "C:\Users\enjoy\AppData\Local\Programs\Python\Python310\lib\asyncio\runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "C:\Users\enjoy\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 633, in run_until_complete
    self.run_forever()
  File "C:\Users\enjoy\AppData\Local\Programs\Python\Python310\lib\asyncio\windows_events.py", line 321, in run_forever
    super().run_forever()
  File "C:\Users\enjoy\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 600, in run_forever
    self._run_once()
  File "C:\Users\enjoy\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 1896, in _run_once
    handle._run()
  File "C:\Users\enjoy\AppData\Local\Programs\Python\Python310\lib\asyncio\events.py", line 80, in _run
    self._context.run(self._callback, *self._args)
  File "C:\Users\enjoy\Desktop\bot\bot1\.venv\lib\site-packages\nonebot\message.py", line 141, in _check_matcher
    await _run_matcher(Matcher, bot, event, state, stack, dependency_cache)
> File "C:\Users\enjoy\Desktop\bot\bot1\.venv\lib\site-packages\nonebot\message.py", line 187, in _run_matcher
    await matcher.run(bot, event, state, stack, dependency_cache)
  File "C:\Users\enjoy\Desktop\bot\bot1\.venv\lib\site-packages\nonebot\internal\matcher\matcher.py", line 753, in run
    await self.simple_run(bot, event, state, stack, dependency_cache)
  File "C:\Users\enjoy\Desktop\bot\bot1\.venv\lib\site-packages\nonebot\internal\matcher\matcher.py", line 728, in simple_run
    await handler(
  File "C:\Users\enjoy\Desktop\bot\bot1\.venv\lib\site-packages\nonebot\dependencies\__init__.py", line 108, in __call__
    return await cast(Callable[..., Awaitable[R]], self.call)(**values)
  File "C:\Users\enjoy\Desktop\bot\bot1\.venv\lib\site-packages\nonebot_plugin_bing_chat\onebotv11\main.py", line 121, in bingchat_command_chat
    raise exc
  File "C:\Users\enjoy\Desktop\bot\bot1\.venv\lib\site-packages\nonebot_plugin_bing_chat\onebotv11\main.py", line 112, in bingchat_command_chat
    response = await chatbot.ask(
  File "C:\Users\enjoy\Desktop\bot\bot1\.venv\lib\site-packages\EdgeGPT.py", line 376, in ask
    async for final, response in self.chat_hub.ask_stream(
  File "C:\Users\enjoy\Desktop\bot\bot1\.venv\lib\site-packages\EdgeGPT.py", line 293, in ask_stream
    self.wss = await websockets.connect(
  File "C:\Users\enjoy\Desktop\bot\bot1\.venv\lib\site-packages\websockets\legacy\client.py", line 655, in __await_impl_timeout__
    return await self.__await_impl__()
  File "C:\Users\enjoy\Desktop\bot\bot1\.venv\lib\site-packages\websockets\legacy\client.py", line 662, in __await_impl__
    await protocol.handshake(
  File "C:\Users\enjoy\Desktop\bot\bot1\.venv\lib\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
Amber-siley commented 1 year ago

测试win11,win2012r2: 插件版本:0.7.11 EdgeGPT==0.2.1 已使用代理端口美国

Amber-siley commented 1 year ago

env配置:


#bing
bingchat_command_chat=["bing"]     #对话命令
bingchat_display_is_waiting="True"  #是否显示“正在请求”
bingchat_share_chat="True"  #他人是否可以用过回复bot而进行对话
bingchat_command_history_chat=["bing-his"]    #历史聊天
bingchat_proxy="http://127.0.0.1:1082"    #代理地址
bingchat_command_new_chat=["bing-new","刷新"]   #新建对话命令
bingchat_conversation_style="creative"  #模式```