lss233 / chatgpt-mirai-qq-bot

🚀 一键部署!真正的 AI 聊天机器人!支持ChatGPT、文心一言、讯飞星火、Bing、Bard、ChatGLM、POE,多账号,人设调教,虚拟女仆、图片渲染、语音发送 | 支持 QQ、Telegram、Discord、微信 等平台
GNU Affero General Public License v3.0
13.27k stars 1.56k forks source link

[BUG] New Bing 重定向次数过多无法响应 #365

Closed horizon86 closed 1 year ago

horizon86 commented 1 year ago

提交 issue 前,请先确认:

表现
默认ai设置成bing,发送一句话后:

2023-03-15 20:27:38,297 - asyncio - ERROR - default_exception_handler - Task exception was never retrieved
future: <Task finished name='Task-21' coro=<CQHttp._handle_event_with_response() done, defined at D:\ProgramData\envs\qq\Lib\site-packages\aiocqhttp\__init__.py:606> exception=TooManyRedirects('Exceeded 30 redirects.')>
Traceback (most recent call last):
  File "D:\ProgramData\envs\qq\Lib\site-packages\aiocqhttp\__init__.py", line 608, in _handle_event_with_response
    response = await self._handle_event(payload)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\ProgramData\envs\qq\Lib\site-packages\aiocqhttp\__init__.py", line 601, in _handle_event
    filter(lambda r: r is not None, await
                                    ^^^^^
  File "D:\ProgramData\envs\qq\Lib\site-packages\aiocqhttp\bus.py", line 60, in emit
    results += await run_async_funcs(self._subscribers[event], *args,
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\ProgramData\envs\qq\Lib\site-packages\aiocqhttp\utils.py", line 40, in run_async_funcs
    results += await asyncio.gather(*coros)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "d:\project\QQbot\chatgpt-mirai-qq-bot\onebot_bot.py", line 125, in _
    await handle_message(response, f"group-{event.user_id}", chain.display)
  File "d:\project\QQbot\chatgpt-mirai-qq-bot\universal.py", line 49, in handle_message
    conversation_handler.current_conversation = await conversation_handler.create(
                                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "d:\project\QQbot\chatgpt-mirai-qq-bot\conversation.py", line 156, in create
    conversation = ConversationContext(_type, self.session_id)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "d:\project\QQbot\chatgpt-mirai-qq-bot\conversation.py", line 49, in __init__
    self.adapter = BingAdapter(self.session_id, ConversationStyle.balanced)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "d:\project\QQbot\chatgpt-mirai-qq-bot\adapter\ms\bing.py", line 31, in __init__
    self.bot = EdgeChatbot(cookies=self.cookieData)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\ProgramData\envs\qq\Lib\site-packages\EdgeGPT.py", line 269, in __init__
    self.chat_hub: ChatHub = ChatHub(Conversation(self.cookiePath, self.cookies))
                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\ProgramData\envs\qq\Lib\site-packages\EdgeGPT.py", line 178, in __init__
    response = self.session.get(
               ^^^^^^^^^^^^^^^^^
  File "D:\ProgramData\envs\qq\Lib\site-packages\requests\sessions.py", line 600, in get
    return self.request("GET", url, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\ProgramData\envs\qq\Lib\site-packages\requests\sessions.py", line 587, in request
    resp = self.send(prep, **send_kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\ProgramData\envs\qq\Lib\site-packages\requests\sessions.py", line 723, in send
    history = [resp for resp in gen]
              ^^^^^^^^^^^^^^^^^^^^^^
  File "D:\ProgramData\envs\qq\Lib\site-packages\requests\sessions.py", line 723, in <listcomp>
    history = [resp for resp in gen]
              ^^^^^^^^^^^^^^^^^^^^^^
  File "D:\ProgramData\envs\qq\Lib\site-packages\requests\sessions.py", line 191, in resolve_redirects
    raise TooManyRedirects(
requests.exceptions.TooManyRedirects: Exceeded 30 redirects.

运行环境:

复现步骤
描述你是如何触发这个 BUG 的

  1. 给机器人发送一条消息,让他用bing做回答
  2. 没有回答,后台报错

预期行为
应该访问bing然后回答

截图

其他内容

lss233 commented 1 year ago

这个可能是需要上个梯子

horizon86 commented 1 year ago

这个可能是需要上个梯子

搞好了,升级了一下EdgeGPT