-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] 无法正常使用bing chat:“'async for' requires an object with __aiter__ method, got coroutine” #252
Labels
bug
Something isn't working
Comments
同样的错误+1
|
v2.0.1 已修复 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
提交 issue 前,请先确认:
表现
向bot发送任意消息,报错“'async for' requires an object with aiter method, got coroutine”,即使发送重置会话也继续相同报错。
运行环境:
复现步骤
描述你是如何触发这个 BUG 的
截图
chatgpt-qq-mirai-1 | 2023-03-04 01:12:33 V/Bot.2463724346: Moki.(2657447616) -> 切换AI bing
chatgpt-qq-chatgpt-1 | 2023-03-04 01:12:33.834 | INFO | graia.ariadne.model:log:82 - 2463724346: [RECV][Moki.(2657447616)] -> 切换AI bing
chatgpt-qq-chatgpt-1 | 2023-03-04 01:12:33.850 | DEBUG | middlewares.timeout:create_timeout_task:14 - [Timeout] 开始计时……
chatgpt-qq-mirai-1 | 2023-03-04 01:12:35 V/Bot.2463724346: Friend(2657447616) <- [mirai:quote:[mirai:source:ids=[19953], internalIds=[-1733548538], from friend 2657447616 to 2463724346 at 1677892353], content=切换AI bing]已切换至 bing,现在开始和我聊天吧!
chatgpt-qq-chatgpt-1 | 2023-03-04 01:12:35.172 | INFO | graia.ariadne.model:log:82 - 2463724346: [SEND][Moki.(2657447616)] <- 已切换至 bing,现在开始和我聊天吧!
chatgpt-qq-chatgpt-1 | 2023-03-04 01:12:35.172 | DEBUG | middlewares.timeout:on_respond:38 - [Timeout] 取消计时……
chatgpt-qq-chatgpt-1 | 2023-03-04 01:12:40.494 | INFO | graia.ariadne.model:log:82 - 2463724346: [RECV][Moki.(2657447616)] -> 你好
chatgpt-qq-chatgpt-1 | 2023-03-04 01:12:40.498 | DEBUG | middlewares.timeout:create_timeout_task:14 - [Timeout] 开始计时……
chatgpt-qq-chatgpt-1 | /app/conversation.py:68: RuntimeWarning: coroutine 'BotAdapter.preset_ask' was never awaited
chatgpt-qq-chatgpt-1 | async for item in self.adapter.preset_ask(role=role.lower().strip(), text=text.strip()):
chatgpt-qq-chatgpt-1 | RuntimeWarning: Enable tracemalloc to get the object allocation traceback
chatgpt-qq-chatgpt-1 | 2023-03-04 01:12:40.501 | ERROR | main:request:180 - 'async for' requires an object with aiter method, got coroutine
chatgpt-qq-chatgpt-1 | Traceback (most recent call last):
chatgpt-qq-chatgpt-1 |
chatgpt-qq-chatgpt-1 | File "/app/bot.py", line 291, in
chatgpt-qq-chatgpt-1 | app.launch_blocking()
chatgpt-qq-chatgpt-1 | │ └ <classmethod object at 0x7f83a96cbbe0>
chatgpt-qq-chatgpt-1 | └ <graia.ariadne.app.Ariadne object at 0x7f83db1c3b20>
chatgpt-qq-chatgpt-1 |
chatgpt-qq-chatgpt-1 | File "/usr/local/lib/python3.9/site-packages/graia/ariadne/app.py", line 312, in launch_blocking
chatgpt-qq-chatgpt-1 | cls.launch_manager.launch_blocking(loop=cls.service.loop, stop_signal=stop_signals)
chatgpt-qq-chatgpt-1 | │ │ │ │ │ │ └ (<Signals.SIGINT: 2>,)
chatgpt-qq-chatgpt-1 | │ │ │ │ │ └ <property object at 0x7f83a9658040>
chatgpt-qq-chatgpt-1 | │ │ │ │ └ <graia.ariadne.service.ElizabethService object at 0x7f83db15ba30>
chatgpt-qq-chatgpt-1 | │ │ │ └ <class 'graia.ariadne.app.Ariadne'>
chatgpt-qq-chatgpt-1 | │ │ └ <function Launart.launch_blocking at 0x7f83aa8a8b80>
chatgpt-qq-chatgpt-1 | │ └ <launart.manager.Launart object at 0x7f83a8974940>
chatgpt-qq-chatgpt-1 | └ <class 'graia.ariadne.app.Ariadne'>
chatgpt-qq-chatgpt-1 | File "/usr/local/lib/python3.9/site-packages/launart/manager.py", line 494, in launch_blocking
chatgpt-qq-chatgpt-1 | loop.run_until_complete(launch_task)
chatgpt-qq-chatgpt-1 | │ │ └ <Task pending name='amnesia-launch' coro=<Launart.launch() running at /usr/local/lib/python3.9/site-packages/launart/manager....
chatgpt-qq-chatgpt-1 | │ └ <function BaseEventLoop.run_until_complete at 0x7f83d9e8b8b0>
chatgpt-qq-chatgpt-1 | └ <_UnixSelectorEventLoop running=True closed=False debug=False>
chatgpt-qq-chatgpt-1 | File "/usr/local/lib/python3.9/asyncio/base_events.py", line 634, in run_until_complete
chatgpt-qq-chatgpt-1 | self.run_forever()
chatgpt-qq-chatgpt-1 | │ └ <function BaseEventLoop.run_forever at 0x7f83d9e8b820>
chatgpt-qq-chatgpt-1 | └ <_UnixSelectorEventLoop running=True closed=False debug=False>
chatgpt-qq-chatgpt-1 | File "/usr/local/lib/python3.9/asyncio/base_events.py", line 601, in run_forever
chatgpt-qq-chatgpt-1 | self._run_once()
chatgpt-qq-chatgpt-1 | │ └ <function BaseEventLoop._run_once at 0x7f83d9e8e3a0>
chatgpt-qq-chatgpt-1 | └ <_UnixSelectorEventLoop running=True closed=False debug=False>
chatgpt-qq-chatgpt-1 | File "/usr/local/lib/python3.9/asyncio/base_events.py", line 1905, in _run_once
chatgpt-qq-chatgpt-1 | handle._run()
chatgpt-qq-chatgpt-1 | │ └ <function Handle._run at 0x7f83d9eacdc0>
chatgpt-qq-chatgpt-1 | └ <Handle <TaskStepMethWrapper object at 0x7f8393690280>()>
chatgpt-qq-chatgpt-1 | File "/usr/local/lib/python3.9/asyncio/events.py", line 80, in _run
chatgpt-qq-chatgpt-1 | self._context.run(self._callback, *self._args)
chatgpt-qq-chatgpt-1 | │ │ │ │ │ └ <member '_args' of 'Handle' objects>
chatgpt-qq-chatgpt-1 | │ │ │ │ └ <Handle <TaskStepMethWrapper object at 0x7f8393690280>()>
chatgpt-qq-chatgpt-1 | │ │ │ └ <member '_callback' of 'Handle' objects>
chatgpt-qq-chatgpt-1 | │ │ └ <Handle <TaskStepMethWrapper object at 0x7f8393690280>()>
chatgpt-qq-chatgpt-1 | │ └ <member '_context' of 'Handle' objects>
chatgpt-qq-chatgpt-1 | └ <Handle <TaskStepMethWrapper object at 0x7f8393690280>()>
chatgpt-qq-chatgpt-1 |
chatgpt-qq-chatgpt-1 | > File "/app/bot.py", line 150, in request
chatgpt-qq-chatgpt-1 | async for _ in conversation_handler.current_conversation.load_preset('default'): ...
chatgpt-qq-chatgpt-1 | │ │ └ <function ConversationContext.load_preset at 0x7f83a8a1d160>
chatgpt-qq-chatgpt-1 | │ └ <conversation.ConversationContext object at 0x7f83a88c0e80>
chatgpt-qq-chatgpt-1 | └ <conversation.ConversationHandler object at 0x7f83a88c04c0>
chatgpt-qq-chatgpt-1 |
chatgpt-qq-chatgpt-1 | File "/app/conversation.py", line 68, in load_preset
chatgpt-qq-chatgpt-1 | async for item in self.adapter.preset_ask(role=role.lower().strip(), text=text.strip()):
chatgpt-qq-chatgpt-1 | │ │ │ │ │ │ └ <method 'strip' of 'str' objects>
chatgpt-qq-chatgpt-1 | │ │ │ │ │ └ ''
chatgpt-qq-chatgpt-1 | │ │ │ │ └ <method 'lower' of 'str' objects>
chatgpt-qq-chatgpt-1 | │ │ │ └ 'system'
chatgpt-qq-chatgpt-1 | │ │ └ <function BotAdapter.preset_ask at 0x7f83d9a05b80>
chatgpt-qq-chatgpt-1 | │ └ <adapter.ms.bing.BingAdapter object at 0x7f83937e99d0>
chatgpt-qq-chatgpt-1 | └ <conversation.ConversationContext object at 0x7f83a88c0e80>
chatgpt-qq-chatgpt-1 |
chatgpt-qq-chatgpt-1 | TypeError: 'async for' requires an object with aiter method, got coroutine
chatgpt-qq-mirai-1 | 2023-03-04 01:12:40 V/Bot.2463724346: Moki.(2657447616) -> 你好
chatgpt-qq-mirai-1 | 2023-03-04 01:12:40 V/Bot.2463724346: Friend(2657447616) <- [mirai:quote:[mirai:source:ids=[19954], internalIds=[2061039514], from friend 2657447616 to 2463724346 at 1677892359], content=你好]出现故障!如果这个问题持续出现,请和我说“重置会话” 来开启一段新的会话,或者发送 “回滚会话” 来回溯到上一条对话,你上一条说的我就当作没看见。如果报错仍旧存在,请与号主2657447616联系。\n'async for' requires an object with aiter method, got coroutine
chatgpt-qq-chatgpt-1 | 2023-03-04 01:12:40.965 | INFO | graia.ariadne.model:log:82 - 2463724346: [SEND][Moki.(2657447616)] <- 出现故障!如果这个问题持续出现,请和我说“重置会话” 来开启一段新的会话,或者发送 “回滚会话” 来回溯到上一条对话,你上一条说的我就当作没看见。如果报错仍旧存在,请与号主2657447616联系。\n'async for' requires an object with aiter method, got coroutine
chatgpt-qq-chatgpt-1 | 2023-03-04 01:12:40.966 | DEBUG | middlewares.timeout:on_respond:38 - [Timeout] 取消计时……
chatgpt-qq-chatgpt-1 | 2023-03-04 01:12:48.433 | INFO | graia.ariadne.model:log:82 - 2463724346: [RECV][Moki.(2657447616)] -> 重置会话
chatgpt-qq-chatgpt-1 | 2023-03-04 01:12:48.436 | DEBUG | middlewares.timeout:create_timeout_task:14 - [Timeout] 开始计时……
chatgpt-qq-chatgpt-1 | 2023-03-04 01:12:48.436 | ERROR | main:request:180 - 'async for' requires an object with aiter method, got coroutine
chatgpt-qq-chatgpt-1 | Traceback (most recent call last):
chatgpt-qq-chatgpt-1 |
chatgpt-qq-chatgpt-1 | File "/app/bot.py", line 291, in
chatgpt-qq-chatgpt-1 | app.launch_blocking()
chatgpt-qq-chatgpt-1 | │ └ <classmethod object at 0x7f83a96cbbe0>
chatgpt-qq-chatgpt-1 | └ <graia.ariadne.app.Ariadne object at 0x7f83db1c3b20>
chatgpt-qq-chatgpt-1 |
chatgpt-qq-chatgpt-1 | File "/usr/local/lib/python3.9/site-packages/graia/ariadne/app.py", line 312, in launch_blocking
chatgpt-qq-chatgpt-1 | cls.launch_manager.launch_blocking(loop=cls.service.loop, stop_signal=stop_signals)
chatgpt-qq-chatgpt-1 | │ │ │ │ │ │ └ (<Signals.SIGINT: 2>,)
chatgpt-qq-chatgpt-1 | │ │ │ │ │ └ <property object at 0x7f83a9658040>
chatgpt-qq-chatgpt-1 | │ │ │ │ └ <graia.ariadne.service.ElizabethService object at 0x7f83db15ba30>
chatgpt-qq-chatgpt-1 | │ │ │ └ <class 'graia.ariadne.app.Ariadne'>
chatgpt-qq-chatgpt-1 | │ │ └ <function Launart.launch_blocking at 0x7f83aa8a8b80>
chatgpt-qq-chatgpt-1 | │ └ <launart.manager.Launart object at 0x7f83a8974940>
chatgpt-qq-chatgpt-1 | └ <class 'graia.ariadne.app.Ariadne'>
chatgpt-qq-chatgpt-1 | File "/usr/local/lib/python3.9/site-packages/launart/manager.py", line 494, in launch_blocking
chatgpt-qq-chatgpt-1 | loop.run_until_complete(launch_task)
chatgpt-qq-chatgpt-1 | │ │ └ <Task pending name='amnesia-launch' coro=<Launart.launch() running at /usr/local/lib/python3.9/site-packages/launart/manager....
chatgpt-qq-chatgpt-1 | │ └ <function BaseEventLoop.run_until_complete at 0x7f83d9e8b8b0>
chatgpt-qq-chatgpt-1 | └ <_UnixSelectorEventLoop running=True closed=False debug=False>
chatgpt-qq-chatgpt-1 | File "/usr/local/lib/python3.9/asyncio/base_events.py", line 634, in run_until_complete
chatgpt-qq-chatgpt-1 | self.run_forever()
chatgpt-qq-chatgpt-1 | │ └ <function BaseEventLoop.run_forever at 0x7f83d9e8b820>
chatgpt-qq-chatgpt-1 | └ <_UnixSelectorEventLoop running=True closed=False debug=False>
chatgpt-qq-chatgpt-1 | File "/usr/local/lib/python3.9/asyncio/base_events.py", line 601, in run_forever
chatgpt-qq-chatgpt-1 | self._run_once()
chatgpt-qq-chatgpt-1 | │ └ <function BaseEventLoop._run_once at 0x7f83d9e8e3a0>
chatgpt-qq-chatgpt-1 | └ <_UnixSelectorEventLoop running=True closed=False debug=False>
chatgpt-qq-chatgpt-1 | File "/usr/local/lib/python3.9/asyncio/base_events.py", line 1905, in _run_once
chatgpt-qq-chatgpt-1 | handle._run()
chatgpt-qq-chatgpt-1 | │ └ <function Handle._run at 0x7f83d9eacdc0>
chatgpt-qq-chatgpt-1 | └ <Handle <TaskStepMethWrapper object at 0x7f83937e9ee0>()>
chatgpt-qq-chatgpt-1 | File "/usr/local/lib/python3.9/asyncio/events.py", line 80, in _run
chatgpt-qq-chatgpt-1 | self._context.run(self._callback, *self._args)
chatgpt-qq-chatgpt-1 | │ │ │ │ │ └ <member '_args' of 'Handle' objects>
chatgpt-qq-chatgpt-1 | │ │ │ │ └ <Handle <TaskStepMethWrapper object at 0x7f83937e9ee0>()>
chatgpt-qq-chatgpt-1 | │ │ │ └ <member '_callback' of 'Handle' objects>
chatgpt-qq-chatgpt-1 | │ │ └ <Handle <TaskStepMethWrapper object at 0x7f83937e9ee0>()>
chatgpt-qq-chatgpt-1 | │ └ <member '_context' of 'Handle' objects>
chatgpt-qq-chatgpt-1 | └ <Handle <TaskStepMethWrapper object at 0x7f83937e9ee0>()>
chatgpt-qq-chatgpt-1 |
chatgpt-qq-chatgpt-1 | > File "/app/bot.py", line 150, in request
chatgpt-qq-chatgpt-1 | async for _ in conversation_handler.current_conversation.load_preset('default'): ...
chatgpt-qq-chatgpt-1 | │ │ └ <function ConversationContext.load_preset at 0x7f83a8a1d160>
chatgpt-qq-chatgpt-1 | │ └ <conversation.ConversationContext object at 0x7f83a88c0e80>
chatgpt-qq-chatgpt-1 | └ <conversation.ConversationHandler object at 0x7f83a88c04c0>
chatgpt-qq-chatgpt-1 |
chatgpt-qq-chatgpt-1 | File "/app/conversation.py", line 68, in load_preset
chatgpt-qq-chatgpt-1 | async for item in self.adapter.preset_ask(role=role.lower().strip(), text=text.strip()):
chatgpt-qq-chatgpt-1 | │ │ │ │ │ │ └ <method 'strip' of 'str' objects>
chatgpt-qq-chatgpt-1 | │ │ │ │ │ └ ''
chatgpt-qq-chatgpt-1 | │ │ │ │ └ <method 'lower' of 'str' objects>
chatgpt-qq-chatgpt-1 | │ │ │ └ 'system'
chatgpt-qq-chatgpt-1 | │ │ └ <function BotAdapter.preset_ask at 0x7f83d9a05b80>
chatgpt-qq-chatgpt-1 | │ └ <adapter.ms.bing.BingAdapter object at 0x7f83937e99d0>
chatgpt-qq-chatgpt-1 | └ <conversation.ConversationContext object at 0x7f83a88c0e80>
chatgpt-qq-chatgpt-1 |
chatgpt-qq-chatgpt-1 | TypeError: 'async for' requires an object with aiter method, got coroutine
chatgpt-qq-mirai-1 | 2023-03-04 01:12:48 V/Bot.2463724346: Moki.(2657447616) -> 重置会话
chatgpt-qq-mirai-1 | 2023-03-04 01:12:49 V/Bot.2463724346: Friend(2657447616) <- [mirai:quote:[mirai:source:ids=[19955], internalIds=[-43511921], from friend 2657447616 to 2463724346 at 1677892367], content=重置会话]出现故障!如果这个问题持续出现,请和我说“重置会话” 来开启一段新的会话,或者发送 “回滚会话” 来回溯到上一条对话,你上一条说的我就当作没看见。如果报错仍旧存在,请与号主2657447616联系。\n'async for' requires an object with aiter method, got coroutine
chatgpt-qq-chatgpt-1 | 2023-03-04 01:12:49.086 | INFO | graia.ariadne.model:log:82 - 2463724346: [SEND][Moki.(2657447616)] <- 出现故障!如果这个问题持续出现,请和我说“重置会话” 来开启一段新的会话,或者发送 “回滚会话” 来回溯到上一条对话,你上一条说的我就当作没看见。如果报错仍旧存在,请与号主2657447616联系。\n'async for' requires an object with aiter method, got coroutine
chatgpt-qq-chatgpt-1 | 2023-03-04 01:12:49.087 | DEBUG | middlewares.timeout:on_respond:38 - [Timeout] 取消计时……
其他内容
此处填写其他内容,没有可跳过
The text was updated successfully, but these errors were encountered: