thx114 / SDGPT

ChatBot for NoneBot : 链接 ChatGPT / Bing / Stable-Diffusion : ChatGPT Bing聊天, gpt解析自然语言转Stable-Diffusion生成图像
MIT License
27 stars 2 forks source link

使用chat指令时报错 #6

Open Muzych opened 1 year ago

Muzych commented 1 year ago

[WARN][配置检查] bing cookies.json 加载失败,无法使用bing [WARN][配置检查] 你设定的 Poe 的 token 为空,跳过载入 [OK][所有AI] 已加载1个AI: chatgpt [WARN][配置检查] 你配置的 defaultAI 不存在或未加载 [OK][默认AI] 默认AI自动切换为chatgpt [OK][预设加载] tag : ./presets/PromptGenerator.txt [nonebot]Succeeded to load plugin "nonebot-plugin-SDGPT" from "plugins.nonebot-plugin-SDGPT" [nonebot]Succeeded to load plugin "weather" from "plugins.weather" [nonebot]Running NoneBot... [uvicorn]Started server process [313264] INFO:uvicorn.error:Started server process [313264] [uvicorn]Waiting for application startup. INFO:uvicorn.error:Waiting for application startup. [uvicorn]Application startup complete. INFO:uvicorn.error:Application startup complete. [uvicorn]Uvicorn running on http://127.0.0.1:8080 (Press CTRL+C to quit) INFO:uvicorn.error:Uvicorn running on http://127.0.0.1:8080 (Press CTRL+C to quit) [uvicorn]('127.0.0.1', 33266) - "WebSocket /onebot/v11/ws" [accepted] INFO:uvicorn.error:('127.0.0.1', 33266) - "WebSocket /onebot/v11/ws" [accepted] [nonebot]Event will be handled by Matcher(type='message', module=plugins.nonebot-plugin-SDGPT) [chatgpt] 对话: 你好 [ASK] 你好 [nonebot]Matcher(type='message', module=plugins.nonebot-plugin-SDGPT) running complete [ERROR][nonebot]Running Matcher(type='message', module=plugins.nonebot-plugin-SDGPT) failed. Traceback (most recent call last):

File "/opt/qq-robot/src/bot.py", line 17, in nonebot.run() │ └ <function run at 0x7f1d93c152d0> └ <module 'nonebot' from '/root/.cache/pypoetry/virtualenvs/qq-robot-zU0nk0Db-py3.10/lib/python3.10/site-packages/nonebot/__ini...

File "/root/.cache/pypoetry/virtualenvs/qq-robot-zU0nk0Db-py3.10/lib/python3.10/site-packages/nonebot/init.py", line 309, in run get_driver().run(*args, **kwargs) │ │ └ {} │ └ () └ <function get_driver at 0x7f1d93c15090> File "/root/.cache/pypoetry/virtualenvs/qq-robot-zU0nk0Db-py3.10/lib/python3.10/site-packages/nonebot/drivers/fastapi.py", line 198, in run uvicorn.run( │ └ <function run at 0x7f1d934f7a30> └ <module 'uvicorn' from '/root/.cache/pypoetry/virtualenvs/qq-robot-zU0nk0Db-py3.10/lib/python3.10/site-packages/uvicorn/ini... File "/root/.cache/pypoetry/virtualenvs/qq-robot-zU0nk0Db-py3.10/lib/python3.10/site-packages/uvicorn/main.py", line 587, in run server.run() │ └ <function Server.run at 0x7f1d934f7be0> └ <uvicorn.server.Server object at 0x7f1d57970730> File "/root/.cache/pypoetry/virtualenvs/qq-robot-zU0nk0Db-py3.10/lib/python3.10/site-packages/uvicorn/server.py", line 61, in run return asyncio.run(self.serve(sockets=sockets)) │ │ │ │ └ None │ │ │ └ <function Server.serve at 0x7f1d934f7c70> │ │ └ <uvicorn.server.Server object at 0x7f1d57970730> │ └ <function run at 0x7f1d94d76170> └ <module 'asyncio' from '/usr/lib/python3.10/asyncio/init__.py'> File "/usr/lib/python3.10/asyncio/runners.py", line 44, in run return loop.run_until_complete(main) │ │ └ <coroutine object Server.serve at 0x7f1d932a6ff0> │ └ <method 'run_until_complete' of 'uvloop.loop.Loop' objects> └ File "/root/.cache/pypoetry/virtualenvs/qq-robot-zU0nk0Db-py3.10/lib/python3.10/site-packages/nonebot/message.py", line 467, in check_and_run_matcher await _run_matcher( └ <function _run_matcher at 0x7f1d939801f0>

File "/root/.cache/pypoetry/virtualenvs/qq-robot-zU0nk0Db-py3.10/lib/python3.10/site-packages/nonebot/message.py", line 419, in _run_matcher await matcher.run(bot, event, state, stack, dependency_cache) │ │ │ │ │ │ └ {<function _command at 0x7f1d93c58dc0>: <Task finished name='Task-186' coro=<_command() done, defined at /root/.cache/pypoetr... │ │ │ │ │ └ <contextlib.AsyncExitStack object at 0x7f1d579d1e40> │ │ │ │ └ {'_prefix': {'command': ('chat',), 'raw_command': '/chat', 'command_arg': [MessageSegment(type='text', data={'text': '你好'})],... │ │ │ └ GroupMessageEvent(time=1690020629, self_id=28179601123, post_type='message', sub_type='normal', user_id=132411332, message_ty... │ │ └ Bot(type='OneBot V11', self_id='281796120173') │ └ <function Matcher.run at 0x7f1d93c589d0> └ Matcher(type='message', module=plugins.nonebot-plugin-SDGPT) File "/root/.cache/pypoetry/virtualenvs/qq-robot-zU0nk0Db-py3.10/lib/python3.10/site-packages/nonebot/internal/matcher/matcher.py", line 753, in run await self.simple_run(bot, event, state, stack, dependency_cache) │ │ │ │ │ │ └ {<function _command at 0x7f1d93c58dc0>: <Task finished name='Task-186' coro=<_command() done, defined at /root/.cache/pypoetr... │ │ │ │ │ └ <contextlib.AsyncExitStack object at 0x7f1d579d1e40> │ │ │ │ └ {'_prefix': {'command': ('chat',), 'raw_command': '/chat', 'command_arg': [MessageSegment(type='text', data={'text': '你好'})],... │ │ │ └ GroupMessageEvent(time=1690020629, self_id=28179260173, post_type='message', sub_type='normal', user_id=15817926032, message_ty... │ │ └ Bot(type='OneBot V11', self_id='28179160173') │ └ <function Matcher.simple_run at 0x7f1d93c58940> └ Matcher(type='message', module=plugins.nonebot-plugin-SDGPT) File "/root/.cache/pypoetry/virtualenvs/qq-robot-zU0nk0Db-py3.10/lib/python3.10/site-packages/nonebot/internal/matcher/matcher.py", line 728, in simplerun await handler( └ Dependent(call=) File "/root/.cache/pypoetry/virtualenvs/qq-robot-zU0nk0Db-py3.10/lib/python3.10/site-packages/nonebot/dependencies/init.py", line 108, in call return await cast(Callable[..., Awaitable[R]], self.call)(**values) │ │ │ │ │ │ └ {'foo': Bot(type='OneBot V11', self_id='2817232173'), 'event': GroupMessageEvent(time=1690020629, self_id=28111260173, postty... │ │ │ │ │ └ <function at 0x7f1d640edfc0> │ │ │ │ └ Dependent(call=_) │ │ │ └ ~R │ │ └ typing.Awaitable │ └ typing.Callable └ <function cast at 0x7f1d950b2c20>

File "/opt/qq-robot/src/plugins/nonebot-plugin-SDGPT/init.py", line 56, in _ await Chat(event, foo, BOT, message) │ │ │ │ └ '你好' │ │ │ └ 'chatgpt' │ │ └ Bot(type='OneBot V11', self_id='2817960173') │ └ GroupMessageEvent(time=1690020629, self_id=20660173, post_type='message', sub_type='normal', user_id=152062062, message_ty... └ <function Chat at 0x7f1d64035c60>

File "/opt/qq-robot/src/plugins/nonebot-plugin-SDGPT/bot.py", line 78, in Chat out = await ask(BOT, message, p) │ │ │ └ '' │ │ └ '你好' │ └ 'chatgpt' └ <function ask at 0x7f1d64035cf0>

File "/opt/qq-robot/src/plugins/nonebot-plugin-SDGPT/bot.py", line 93, in ask async for data in chatgpt.ask(message): │ │ │ └ '你好' │ │ └ <function AsyncChatbot.ask at 0x7f1d645fa290> │ └ <revChatGPT.V1.AsyncChatbot object at 0x7f1d640d7ee0> └ {'message': '', 'conversation_id': '52519447-43b5-46c0-b75a-a28f6e14b09f', 'parent_id': '2969a960-3a66-4076-aa03-dbac95881271...

File "/root/.cache/pypoetry/virtualenvs/qq-robot-zU0nk0Db-py3.10/lib/python3.10/site-packages/revChatGPT/V1.py", line 1004, in ask async for msg in self.post_messages( │ │ └ <function AsyncChatbot.post_messages at 0x7f1d645fa200> │ └ <revChatGPT.V1.AsyncChatbot object at 0x7f1d640d7ee0> └ {'message': '', 'conversation_id': '52519447-43b5-46c0-b75a-a28f6e14b09f', 'parent_id': '2969a960-3a66-4076-aa03-dbac95881271... File "/root/.cache/pypoetry/virtualenvs/qq-robot-zU0nk0Db-py3.10/lib/python3.10/site-packages/revChatGPT/V1.py", line 957, in post_messages async for msg in self.__send_request( │ └ <revChatGPT.V1.AsyncChatbot object at 0x7f1d640d7ee0> └ {'message': '', 'conversation_id': '52519447-43b5-46c0-b75a-a28f6e14b09f', 'parent_id': '2969a960-3a66-4076-aa03-dbac95881271... File "/root/.cache/pypoetry/virtualenvs/qq-robot-zU0nk0Db-py3.10/lib/python3.10/site-packages/revChatGPT/V1.py", line 855, in __send_request raise ValueError(f"Field missing. Details: {str(line)}")

ValueError: Field missing. Details: {'conversation_id': '52519447-43b5-46c0-b75a-a28f6e14b09f', 'message_id': 'd9dd444e-a9c5-4cc1-9538-21d62562bcc4', 'is_completion': False, 'moderation_response': {'flagged': False, 'blocked': False, 'moderation_id': 'modr-7f3rCRt1PS6zexmvvwyIqVObY3eK7'}}