retrofor / iamai

A Comprehensive AI Toolkit for Multimodal Learning and Cross-Platform Robotics(综合性人工智能工具库,强调同时支持多模态机器学习和跨平台机器人构建的能力)
https://iamai.is-a.dev
GNU Affero General Public License v3.0
26 stars 9 forks source link

bug: "adapter" argument must be set #170

Closed HsiangNianian closed 1 year ago

HsiangNianian commented 1 year ago
2023-07-14 22:36:09.644 [SUCCESS] > iamai.adapter.kook:handle_websocket_msg:97 - WebSocket connection verified, Session key: 9f3746e4-f9dd-41ef-b1da-fbb65d887fa3
2023-07-14 22:36:09.648 [INFO] > iamai.adapter.kook:handle_websocket_msg:105 - HeartBeat task started!
2023-07-14 22:36:09.667 [ERROR] > iamai.log:error_or_exception:20 - Run adapter KookAdapter failed:
Traceback (most recent call last):

  File "F:\HsiangNianian\iamai\tests\main.py", line 6, in <module>
    bot.run()
    │   └ <function Bot.run at 0x000001A79E780A40>
    └ <iamai.bot.Bot object at 0x000001A79BE889D0>

  File "C:\Users\22256\AppData\Local\Programs\Python\Python311\Lib\site-packages\iamai\bot.py", line 152, in run
    asyncio.run(self._run())
    │       │   │    └ <function Bot._run at 0x000001A79E782DE0>
    │       │   └ <iamai.bot.Bot object at 0x000001A79BE889D0>
    │       └ <function run at 0x000001A79DD082C0>
    └ <module 'asyncio' from 'C:\\Users\\22256\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\asyncio\\__init__.py'>
  File "C:\Users\22256\AppData\Local\Programs\Python\Python311\Lib\asyncio\runners.py", line 190, in run
    return runner.run(main)
           │      │   └ <coroutine object Bot._run at 0x000001A79E469480>
           │      └ <function Runner.run at 0x000001A79DD84220>
           └ <asyncio.runners.Runner object at 0x000001A79BF045D0>
  File "C:\Users\22256\AppData\Local\Programs\Python\Python311\Lib\asyncio\runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           │    │     │                  └ <Task pending name='Task-1' coro=<Bot._run() running at C:\Users\22256\AppData\Local\Programs\Python\Python311\Lib\site-packa...
           │    │     └ <function BaseEventLoop.run_until_complete at 0x000001A79DD7DD00>
           │    └ <ProactorEventLoop running=True closed=False debug=False>
           └ <asyncio.runners.Runner object at 0x000001A79BF045D0>
  File "C:\Users\22256\AppData\Local\Programs\Python\Python311\Lib\asyncio\base_events.py", line 640, in run_until_complete
    self.run_forever()
    │    └ <function ProactorEventLoop.run_forever at 0x000001A79DE65C60>
    └ <ProactorEventLoop running=True closed=False debug=False>
  File "C:\Users\22256\AppData\Local\Programs\Python\Python311\Lib\asyncio\windows_events.py", line 321, in run_forever
    super().run_forever()
  File "C:\Users\22256\AppData\Local\Programs\Python\Python311\Lib\asyncio\base_events.py", line 607, in run_forever
    self._run_once()
    │    └ <function BaseEventLoop._run_once at 0x000001A79DD7FA60>
    └ <ProactorEventLoop running=True closed=False debug=False>
  File "C:\Users\22256\AppData\Local\Programs\Python\Python311\Lib\asyncio\base_events.py", line 1922, in _run_once
    handle._run()
    │      └ <function Handle._run at 0x000001A79DCBD260>
    └ <Handle Task.task_wakeup(<Future finished result=None>)>
  File "C:\Users\22256\AppData\Local\Programs\Python\Python311\Lib\asyncio\events.py", line 80, in _run
    self._context.run(self._callback, *self._args)
    │    │            │    │           │    └ <member '_args' of 'Handle' objects>
    │    │            │    │           └ <Handle Task.task_wakeup(<Future finished result=None>)>
    │    │            │    └ <member '_callback' of 'Handle' objects>
    │    │            └ <Handle Task.task_wakeup(<Future finished result=None>)>
    │    └ <member '_context' of 'Handle' objects>
    └ <Handle Task.task_wakeup(<Future finished result=None>)>
> File "C:\Users\22256\AppData\Local\Programs\Python\Python311\Lib\site-packages\iamai\adapter\__init__.py", line 54, in safe_run
    await self.run()
          │    └ <function WebSocketAdapter.run at 0x000001A79F6DD620>
          └ <iamai.adapter.kook.KookAdapter object at 0x000001A79F8D7D50>
  File "C:\Users\22256\AppData\Local\Programs\Python\Python311\Lib\site-packages\iamai\adapter\utils.py", line 196, in run
    await self.websocket_connect()
          │    └ <function KookAdapter.websocket_connect at 0x000001A79F88C360>
          └ <iamai.adapter.kook.KookAdapter object at 0x000001A79F8D7D50>
  File "C:\Users\22256\AppData\Local\Programs\Python\Python311\Lib\site-packages\iamai\adapter\kook\__init__.py", line 75, in websocket_connect
    await self.handle_websocket()
          │    └ <function WebSocketAdapter.handle_websocket at 0x000001A79F6DD940>
          └ <iamai.adapter.kook.KookAdapter object at 0x000001A79F8D7D50>
  File "C:\Users\22256\AppData\Local\Programs\Python\Python311\Lib\site-packages\iamai\adapter\utils.py", line 251, in handle_websocket    
    await self.handle_websocket_msg(msg)
          │    │                    └ WSMessage(type=<WSMsgType.TEXT: 1>, data='{"s":1,"d":{"code":0,"sessionId":"9f3746e4-f9dd-41ef-b1da-fbb65d887fa3","session_id...
          │    └ <function KookAdapter.handle_websocket_msg at 0x000001A79F88C400>
          └ <iamai.adapter.kook.KookAdapter object at 0x000001A79F8D7D50>
  File "C:\Users\22256\AppData\Local\Programs\Python\Python311\Lib\site-packages\iamai\adapter\kook\__init__.py", line 106, in handle_websocket_msg
    await self.handle_kook_event(data)
          └ <iamai.adapter.kook.KookAdapter object at 0x000001A79F8D7D50>
  File "C:\Users\22256\AppData\Local\Programs\Python\Python311\Lib\site-packages\iamai\adapter\kook\__init__.py", line 180, in handle_kook_event
    kook_event = event_class(adatper=self,**data)
                 │                   │      └ {'code': 0, 'sessionId': '9f3746e4-f9dd-41ef-b1da-fbb65d887fa3', 'session_id': '9f3746e4-f9dd-41ef-b1da-fbb65d887fa3', 'post_...
                 │                   └ <iamai.adapter.kook.KookAdapter object at 0x000001A79F8D7D50>
                 └ <class 'iamai.adapter.kook.event.LifecycleMetaEvent'>
  File "C:\Users\22256\AppData\Local\Programs\Python\Python311\Lib\site-packages\iamai\event.py", line 44, in __init__
    raise ValueError('"adapter" argument must be set')

ValueError: "adapter" argument must be set

SG1SCU~TGL0IBR% U90$8_G

HsiangNianian commented 1 year ago
  File "C:\Users\22256\AppData\Local\Programs\Python\Python311\Lib\site-packages\iamai\adapter\kook\__init__.py", line 180, in handle_kook_event
    kook_event = event_class(adatper=self,**data)

180行指名传参adatper应该是adapter