thx114 / sdgpt Goto Github PK
View Code? Open in Web Editor NEWChatBot for NoneBot : 链接 ChatGPT / Bing / Stable-Diffusion : ChatGPT Bing聊天, gpt解析自然语言转Stable-Diffusion生成图像
License: MIT License
ChatBot for NoneBot : 链接 ChatGPT / Bing / Stable-Diffusion : ChatGPT Bing聊天, gpt解析自然语言转Stable-Diffusion生成图像
License: MIT License
[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>
└ <uvloop.Loop running=True closed=False debug=False>
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 simple_run
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, post_ty...
│ │ │ │ │ └ <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'}}
[ERROR][nonebot]Running Matcher(type='message', module=nonebot_plugin_SDGPT) failed.
Traceback (most recent call last):
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\anyio\_core\_sockets.py", line 164, in try_connect
stream = await asynclib.connect_tcp(remote_host, remote_port, local_address)
│ │ │ │ └ None
│ │ │ └ 443
│ │ └ '208.43.170.231'
│ └ <function connect_tcp at 0x000002461EF8CE50>
└ <module 'anyio._backends._asyncio' from 'C:\\Users\\Administrator\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-pac...
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\anyio\_backends\_asyncio.py", line 1691, in connect_tcp
await get_running_loop().create_connection(
└ <built-in function get_running_loop>
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 1064, in create_connection
raise exceptions[0]
└ [OSError(22, '信号灯超时时间已到', None, 121, None)]
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 1049, in create_connection
sock = await self._connect_sock(
│ └ <function BaseEventLoop._connect_sock at 0x0000024675EB20E0>
└ <ProactorEventLoop running=True closed=False debug=False>
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 960, in _connect_sock
await self.sock_connect(sock, address)
│ │ │ └ ('208.43.170.231', 443)
│ │ └ <socket.socket [closed] fd=-1, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6>
│ └ <function BaseProactorEventLoop.sock_connect at 0x0000024677AAF250>
└ <ProactorEventLoop running=True closed=False debug=False>
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\asyncio\proactor_events.py", line 705, in sock_connect
return await self._proactor.connect(sock, address)
│ │ │ │ └ ('208.43.170.231', 443)
│ │ │ └ <socket.socket [closed] fd=-1, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6>
│ │ └ <function IocpProactor.connect at 0x0000024677AE2F80>
│ └ <IocpProactor overlapped#=6 result#=0>
└ <ProactorEventLoop running=True closed=False debug=False>
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\asyncio\windows_events.py", line 817, in _poll
value = callback(transferred, key, ov)
│ │ │ └ <_overlapped.Overlapped object at 0x000002461EF9FCF0>
│ │ └ 0
│ └ 0
└ <function IocpProactor.connect.<locals>.finish_connect at 0x000002461EF9F7F0>
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\asyncio\windows_events.py", line 604, in finish_connect
ov.getresult()
│ └ <method 'getresult' of '_overlapped.Overlapped' objects>
└ <_overlapped.Overlapped object at 0x000002461EF9FCF0>
OSError: [WinError 121] 信号灯超时时间已到
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "E:\IDEAyes\BOT\nonebot2\venv\lib\site-packages\httpcore\_exceptions.py", line 10, in map_exceptions
yield
File "E:\IDEAyes\BOT\nonebot2\venv\lib\site-packages\httpcore\backends\asyncio.py", line 111, in connect_tcp
stream: anyio.abc.ByteStream = await anyio.connect_tcp(
│ │ │ │ └ <function connect_tcp at 0x0000024678590040>
│ │ │ └ <module 'anyio' from 'C:\\Users\\Administrator\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\anyio\\__ini...
│ │ └ <class 'anyio.abc.ByteStream'>
│ └ <module 'anyio.abc' from 'C:\\Users\\Administrator\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\anyio\\a...
└ <module 'anyio' from 'C:\\Users\\Administrator\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\anyio\\__ini...
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\anyio\_core\_sockets.py", line 222, in connect_tcp
raise OSError("All connection attempts failed") from cause
└ OSError(22, '信号灯超时时间已到', None, 121, None)
OSError: All connection attempts failed
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "E:\IDEAyes\BOT\nonebot2\venv\lib\site-packages\httpx\_transports\default.py", line 60, in map_httpcore_exceptions
yield
File "E:\IDEAyes\BOT\nonebot2\venv\lib\site-packages\httpx\_transports\default.py", line 353, in handle_async_request
resp = await self._pool.handle_async_request(req)
│ │ │ └ <Request [b'POST']>
│ │ └ <function AsyncConnectionPool.handle_async_request at 0x0000024679E6FEB0>
│ └ <httpcore.AsyncConnectionPool object at 0x00000246127F4BB0>
└ <httpx.AsyncHTTPTransport object at 0x00000246127F4B80>
File "E:\IDEAyes\BOT\nonebot2\venv\lib\site-packages\httpcore\_async\connection_pool.py", line 253, in handle_async_request
raise exc
File "E:\IDEAyes\BOT\nonebot2\venv\lib\site-packages\httpcore\_async\connection_pool.py", line 237, in handle_async_request
response = await connection.handle_async_request(request)
│ │ └ <Request [b'POST']>
│ └ <function AsyncHTTPConnection.handle_async_request at 0x0000024679E6F0A0>
└ <AsyncHTTPConnection [CONNECTION FAILED]>
File "E:\IDEAyes\BOT\nonebot2\venv\lib\site-packages\httpcore\_async\connection.py", line 86, in handle_async_request
raise exc
File "E:\IDEAyes\BOT\nonebot2\venv\lib\site-packages\httpcore\_async\connection.py", line 63, in handle_async_request
stream = await self._connect(request)
│ │ └ <Request [b'POST']>
│ └ <function AsyncHTTPConnection._connect at 0x0000024679E6F130>
└ <AsyncHTTPConnection [CONNECTION FAILED]>
File "E:\IDEAyes\BOT\nonebot2\venv\lib\site-packages\httpcore\_async\connection.py", line 111, in _connect
stream = await self._network_backend.connect_tcp(**kwargs)
│ │ │ └ {'host': 'api.openai.com', 'port': 443, 'local_address': None, 'timeout': None}
│ │ └ <function AutoBackend.connect_tcp at 0x0000024679E6D870>
│ └ <httpcore.backends.auto.AutoBackend object at 0x00000246127F4CD0>
└ <AsyncHTTPConnection [CONNECTION FAILED]>
File "E:\IDEAyes\BOT\nonebot2\venv\lib\site-packages\httpcore\backends\auto.py", line 29, in connect_tcp
return await self._backend.connect_tcp(
│ │ └ <function AsyncIOBackend.connect_tcp at 0x000002461EF9C670>
│ └ <httpcore.backends.asyncio.AsyncIOBackend object at 0x000002461F01BDF0>
└ <httpcore.backends.auto.AutoBackend object at 0x00000246127F4CD0>
File "E:\IDEAyes\BOT\nonebot2\venv\lib\site-packages\httpcore\backends\asyncio.py", line 109, in connect_tcp
with map_exceptions(exc_map):
│ └ {<class 'TimeoutError'>: <class 'httpcore.ConnectTimeout'>, <class 'OSError'>: <class 'httpcore.ConnectError'>, <class 'anyio...
└ <function map_exceptions at 0x0000024679D35AB0>
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\contextlib.py", line 153, in __exit__
self.gen.throw(typ, value, traceback)
│ │ │ │ │ └ <traceback object at 0x00000246269E02C0>
│ │ │ │ └ OSError('All connection attempts failed')
│ │ │ └ <class 'OSError'>
│ │ └ <method 'throw' of 'generator' objects>
│ └ <generator object map_exceptions at 0x000002461EF73BC0>
└ <contextlib._GeneratorContextManager object at 0x000002461F01BE20>
File "E:\IDEAyes\BOT\nonebot2\venv\lib\site-packages\httpcore\_exceptions.py", line 14, in map_exceptions
raise to_exc(exc)
└ <class 'httpcore.ConnectError'>
httpcore.ConnectError: All connection attempts failed
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "E:\IDEAyes\BOT\nonebot2\bot.py", line 65, in <module>
nonebot.run(app="__mp_main__:app")
│ └ <function run at 0x000002467802DD80>
└ <module 'nonebot' from 'E:\\IDEAyes\\BOT\\nonebot2\\venv\\lib\\site-packages\\nonebot\\__init__.py'>
File "E:\IDEAyes\BOT\nonebot2\venv\lib\site-packages\nonebot\__init__.py", line 309, in run
get_driver().run(*args, **kwargs)
│ │ └ {'app': '__mp_main__:app'}
│ └ ()
└ <function get_driver at 0x000002467802E200>
File "E:\IDEAyes\BOT\nonebot2\venv\lib\site-packages\nonebot\drivers\fastapi.py", line 198, in run
uvicorn.run(
│ └ <function run at 0x00000246784D8A60>
└ <module 'uvicorn' from 'E:\\IDEAyes\\BOT\\nonebot2\\venv\\lib\\site-packages\\uvicorn\\__init__.py'>
File "E:\IDEAyes\BOT\nonebot2\venv\lib\site-packages\uvicorn\main.py", line 569, in run
server.run()
│ └ <function Server.run at 0x00000246784D84C0>
└ <uvicorn.server.Server object at 0x000002461EA3B250>
File "E:\IDEAyes\BOT\nonebot2\venv\lib\site-packages\uvicorn\server.py", line 60, in run
return asyncio.run(self.serve(sockets=sockets))
│ │ │ │ └ None
│ │ │ └ <function Server.serve at 0x00000246784D8550>
│ │ └ <uvicorn.server.Server object at 0x000002461EA3B250>
│ └ <function run at 0x0000024675DAA050>
└ <module 'asyncio' from 'C:\\Users\\Administrator\\AppData\\Local\\Programs\\Python\\Python310\\lib\\asyncio\\__init__.py'>
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\asyncio\runners.py", line 44, in run
return loop.run_until_complete(main)
│ │ └ <coroutine object Server.serve at 0x000002461EA1DE00>
│ └ <function BaseEventLoop.run_until_complete at 0x0000024675EB13F0>
└ <ProactorEventLoop running=True closed=False debug=False>
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 633, in run_until_complete
self.run_forever()
│ └ <function ProactorEventLoop.run_forever at 0x0000024677AE2680>
└ <ProactorEventLoop running=True closed=False debug=False>
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\asyncio\windows_events.py", line 321, in run_forever
super().run_forever()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 600, in run_forever
self._run_once()
│ └ <function BaseEventLoop._run_once at 0x0000024675EB2E60>
└ <ProactorEventLoop running=True closed=False debug=False>
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 1896, in _run_once
handle._run()
│ └ <function Handle._run at 0x0000024675E61BD0>
└ <Handle <TaskStepMethWrapper object at 0x000002461F0186A0>()>
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\asyncio\events.py", line 80, in _run
self._context.run(self._callback, *self._args)
│ │ │ │ │ └ <member '_args' of 'Handle' objects>
│ │ │ │ └ <Handle <TaskStepMethWrapper object at 0x000002461F0186A0>()>
│ │ │ └ <member '_callback' of 'Handle' objects>
│ │ └ <Handle <TaskStepMethWrapper object at 0x000002461F0186A0>()>
│ └ <member '_context' of 'Handle' objects>
└ <Handle <TaskStepMethWrapper object at 0x000002461F0186A0>()>
File "E:\IDEAyes\BOT\nonebot2\venv\lib\site-packages\nonebot\message.py", line 141, in _check_matcher
await _run_matcher(Matcher, bot, event, state, stack, dependency_cache)
│ │ │ │ │ │ └ {<function _command at 0x00000246780A6710>: <Task finished name='Task-2054' coro=<_command() done, defined at E:\IDEAyes\BOT\...
│ │ │ │ │ └ <contextlib.AsyncExitStack object at 0x000002461F00A230>
│ │ │ │ └ {'_prefix': {'command': None, 'raw_command': None, 'command_arg': None, 'command_start': None, 'command_whitespace': None}}
│ │ │ └ GroupMessageEvent(time=1686017612, self_id=3373930780, post_type='message', sub_type='normal', user_id=2922126903, message_ty...
│ │ └ Bot(type='OneBot V11', self_id='3373930780')
│ └ Matcher(type='message', module=nonebot_plugin_SDGPT)
└ <function _run_matcher at 0x00000246781B24D0>
> File "E:\IDEAyes\BOT\nonebot2\venv\lib\site-packages\nonebot\message.py", line 187, in _run_matcher
await matcher.run(bot, event, state, stack, dependency_cache)
│ │ │ │ │ │ └ {<function _command at 0x00000246780A6710>: <Task finished name='Task-2054' coro=<_command() done, defined at E:\IDEAyes\BOT\...
│ │ │ │ │ └ <contextlib.AsyncExitStack object at 0x000002461F00A230>
│ │ │ │ └ {'_prefix': {'command': None, 'raw_command': None, 'command_arg': None, 'command_start': None, 'command_whitespace': None}}
│ │ │ └ GroupMessageEvent(time=1686017612, self_id=3373930780, post_type='message', sub_type='normal', user_id=2922126903, message_ty...
│ │ └ Bot(type='OneBot V11', self_id='3373930780')
│ └ <function Matcher.run at 0x00000246780A6170>
└ Matcher(type='message', module=nonebot_plugin_SDGPT)
File "E:\IDEAyes\BOT\nonebot2\venv\lib\site-packages\nonebot\internal\matcher\matcher.py", line 753, in run
await self.simple_run(bot, event, state, stack, dependency_cache)
│ │ │ │ │ │ └ {<function _command at 0x00000246780A6710>: <Task finished name='Task-2054' coro=<_command() done, defined at E:\IDEAyes\BOT\...
│ │ │ │ │ └ <contextlib.AsyncExitStack object at 0x000002461F00A230>
│ │ │ │ └ {'_prefix': {'command': None, 'raw_command': None, 'command_arg': None, 'command_start': None, 'command_whitespace': None}}
│ │ │ └ GroupMessageEvent(time=1686017612, self_id=3373930780, post_type='message', sub_type='normal', user_id=2922126903, message_ty...
│ │ └ Bot(type='OneBot V11', self_id='3373930780')
│ └ <function Matcher.simple_run at 0x00000246780A60E0>
└ Matcher(type='message', module=nonebot_plugin_SDGPT)
File "E:\IDEAyes\BOT\nonebot2\venv\lib\site-packages\nonebot\internal\matcher\matcher.py", line 728, in simple_run
await handler(
└ Dependent(call=_)
File "E:\IDEAyes\BOT\nonebot2\venv\lib\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='3373930780'), 'event': GroupMessageEvent(time=1686017612, self_id=3373930780, post_ty...
│ │ │ │ │ └ <function _ at 0x000002461352A290>
│ │ │ │ └ Dependent(call=_)
│ │ │ └ ~R
│ │ └ typing.Awaitable
│ └ typing.Callable
└ <function cast at 0x0000024675833EB0>
File "E:\IDEAyes\BOT\nonebot2\venv\lib\site-packages\nonebot_plugin_SDGPT\__init__.py", line 45, in _
await Chat(event, foo, BOT, message)
│ │ │ │ └ '你好'
│ │ │ └ 'chatgpt-api'
│ │ └ Bot(type='OneBot V11', self_id='3373930780')
│ └ GroupMessageEvent(time=1686017612, self_id=3373930780, post_type='message', sub_type='normal', user_id=2922126903, message_ty...
└ <function Chat at 0x00000246127AB400>
File "E:\IDEAyes\BOT\nonebot2\venv\lib\site-packages\nonebot_plugin_SDGPT\bot.py", line 78, in Chat
out = await ask(BOT, message, p)
│ │ │ └ ''
│ │ └ '你好'
│ └ 'chatgpt-api'
└ <function ask at 0x00000246127AB490>
File "E:\IDEAyes\BOT\nonebot2\venv\lib\site-packages\nonebot_plugin_SDGPT\bot.py", line 99, in ask
out = await chatgpt_api.ask_async(message)
│ │ └ '你好'
│ └ <function Chatbot.ask_async at 0x00000246126389D0>
└ <revChatGPT.V3.Chatbot object at 0x0000024612793610>
File "E:\IDEAyes\BOT\nonebot2\venv\lib\site-packages\revChatGPT\V3.py", line 318, in ask_async
full_response: str = "".join([r async for r in response])
└ <async_generator object Chatbot.ask_stream_async at 0x000002461EF5A340>
File "E:\IDEAyes\BOT\nonebot2\venv\lib\site-packages\revChatGPT\V3.py", line 318, in <listcomp>
full_response: str = "".join([r async for r in response])
File "E:\IDEAyes\BOT\nonebot2\venv\lib\site-packages\revChatGPT\V3.py", line 246, in ask_stream_async
async with self.aclient.stream(
│ │ └ <function AsyncClient.stream at 0x0000024679E99EA0>
│ └ <httpx.AsyncClient object at 0x00000246127F4550>
└ <revChatGPT.V3.Chatbot object at 0x0000024612793610>
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\contextlib.py", line 199, in __aenter__
return await anext(self.gen)
│ └ <async_generator object AsyncClient.stream at 0x000002461EF5A3C0>
└ <contextlib._AsyncGeneratorContextManager object at 0x000002461EAA6380>
File "E:\IDEAyes\BOT\nonebot2\venv\lib\site-packages\httpx\_client.py", line 1576, in stream
response = await self.send(
│ └ <function AsyncClient.send at 0x0000024679E99F30>
└ <httpx.AsyncClient object at 0x00000246127F4550>
File "E:\IDEAyes\BOT\nonebot2\venv\lib\site-packages\httpx\_client.py", line 1620, in send
response = await self._send_handling_auth(
│ └ <function AsyncClient._send_handling_auth at 0x0000024679E99FC0>
└ <httpx.AsyncClient object at 0x00000246127F4550>
File "E:\IDEAyes\BOT\nonebot2\venv\lib\site-packages\httpx\_client.py", line 1648, in _send_handling_auth
response = await self._send_handling_redirects(
│ └ <function AsyncClient._send_handling_redirects at 0x0000024679E9A050>
└ <httpx.AsyncClient object at 0x00000246127F4550>
File "E:\IDEAyes\BOT\nonebot2\venv\lib\site-packages\httpx\_client.py", line 1685, in _send_handling_redirects
response = await self._send_single_request(request)
│ │ └ <Request('POST', 'https://api.openai.com/v1/chat/completions')>
│ └ <function AsyncClient._send_single_request at 0x0000024679E9A0E0>
└ <httpx.AsyncClient object at 0x00000246127F4550>
File "E:\IDEAyes\BOT\nonebot2\venv\lib\site-packages\httpx\_client.py", line 1722, in _send_single_request
response = await transport.handle_async_request(request)
│ │ └ <Request('POST', 'https://api.openai.com/v1/chat/completions')>
│ └ <function AsyncHTTPTransport.handle_async_request at 0x0000024679E7F5B0>
└ <httpx.AsyncHTTPTransport object at 0x00000246127F4B80>
File "E:\IDEAyes\BOT\nonebot2\venv\lib\site-packages\httpx\_transports\default.py", line 352, in handle_async_request
with map_httpcore_exceptions():
└ <function map_httpcore_exceptions at 0x0000024679D34160>
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\contextlib.py", line 153, in __exit__
self.gen.throw(typ, value, traceback)
│ │ │ │ │ └ <traceback object at 0x000002461F09A600>
│ │ │ │ └ ConnectError(OSError('All connection attempts failed'))
│ │ │ └ <class 'httpcore.ConnectError'>
│ │ └ <method 'throw' of 'generator' objects>
│ └ <generator object map_httpcore_exceptions at 0x000002461EF73990>
└ <contextlib._GeneratorContextManager object at 0x000002461F0194E0>
File "E:\IDEAyes\BOT\nonebot2\venv\lib\site-packages\httpx\_transports\default.py", line 77, in map_httpcore_exceptions
raise mapped_exc(message) from exc
│ └ 'All connection attempts failed'
└ <class 'httpx.ConnectError'>
httpx.ConnectError: All connection attempts failed
bot.py
中第105行,‘item’写成了‘tiem’
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.