chrisyy2003 / nonebot-plugin-gpt3

A nonebot plugin base on OpenAI API (gpt-3.5-turbo)
112 stars 16 forks source link

nonebot | Running Matcher(type='message', module=nonebot_plugin_gpt3) failed. Traceback (most recent call last): #6

Closed TalentYui closed 1 year ago

TalentYui commented 1 year ago

01-11 12:56:36 [SUCCESS] nonebot | OneBot V11 738386129 | [message.private.friend]: Message 1516341372 from 3258447421 "/gpt3 你好" 01-11 12:56:36 [INFO] nonebot | Event will be handled by Matcher(type='message', module=nonebot_plugin_gpt3) 01-11 12:56:36 [INFO] nonebot | Matcher(type='message', module=nonebot_plugin_gpt3) running complete 01-11 12:56:36 [ERROR] nonebot | Running Matcher(type='message', module=nonebot_plugin_gpt3) failed. Traceback (most recent call last): File "c:\Zsy_files\Zsy_bot\ghcp\Zsybot\bot.py", line 59, in nonebot.run(app="mp_main__:app") File "C:\Zsy_files\Python\lib\site-packages\nonebot\init__.py", line 273, in run get_driver().run(*args, *kwargs) File "C:\Zsy_files\Python\lib\site-packages\nonebot\drivers\fastapi.py", line 172, in run uvicorn.run( File "C:\Zsy_files\Python\lib\site-packages\uvicorn\main.py", line 569, in run server.run() File "C:\Zsy_files\Python\lib\site-packages\uvicorn\server.py", line 60, in run return asyncio.run(self.serve(sockets=sockets)) File "C:\Zsy_files\Python\lib\asyncio\runners.py", line 44, in run return loop.run_until_complete(main) File "C:\Zsy_files\Python\lib\asyncio\base_events.py", line 636, in run_until_complete self.run_forever() File "C:\Zsy_files\Python\lib\asyncio\windows_events.py", line 321, in run_forever super().run_forever() File "C:\Zsy_files\Python\lib\asyncio\base_events.py", line 603, in run_forever self._run_once() File "C:\Zsy_files\Python\lib\asyncio\base_events.py", line 1899, in _run_once handle._run() File "C:\Zsy_files\Python\lib\asyncio\events.py", line 80, in _run self._context.run(self._callback, self._args) File "C:\Zsy_files\Python\lib\site-packages\nonebot\message.py", line 142, in _check_matcher await _run_matcher(Matcher, bot, event, state, stack, dependency_cache)

File "C:\Zsy_files\Python\lib\site-packages\nonebot\message.py", line 188, in _run_matcher await matcher.run(bot, event, state, stack, dependency_cache) File "C:\Zsy_files\Python\lib\site-packages\nonebot\internal\matcher\matcher.py", line 727, in run await self.simple_run(bot, event, state, stack, dependency_cache) File "C:\Zsy_files\Python\lib\site-packages\nonebot\internal\matcher\matcher.py", line 702, in simple_run await handler( File "C:\Zsy_files\Python\lib\site-packages\nonebot\dependencies__init.py", line 108, in call return await cast(Callable[..., Awaitable[R]], self.call)(**values) File "C:\Zsy_files\Python\lib\site-packages\nonebot_plugingpt3__init__.py", line 169, in resp = await get_user_session(session_id).get_chat_response(msg) File "C:\Zsy_files\Python\lib\site-packages\nonebot_plugin_gpt3\init__.py", line 81, in get_chat_response if ok: UnboundLocalError: local variable 'ok' referenced before assignment

chrisyy2003 commented 1 year ago

没填api keys,哥