[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