触发AI回复就报错,可能是我nonebot2配置问题,请指教
每次触发智障AI回复时就报如下错误,刚用不久,不太清楚原因 nonebot2版本为 bate.5
Running matcher <Matcher from src.plugins.nonebot_plugin_smart_replys, type=message, priority=99, temp=False> failed. Traceback (most recent call last): File "~/lib/python3.8/site-packages/httpcore/backends/asyncio.py", line 109, in connect_tcp stream: anyio.abc.ByteStream = await anyio.connect_tcp( File "~/lib/python3.8/site-packages/anyio/_core/_sockets.py", line 218, in connect_tcp await event.wait() File "~/lib/python3.8/site-packages/anyio/_backends/_asyncio.py", line 662, in aexit raise exceptions[0] File "~/lib/python3.8/site-packages/anyio/_backends/_asyncio.py", line 733, in task_done exc = _task.exception() asyncio.exceptions.CancelledError
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "~/lib/python3.8/site-packages/httpcore/_exceptions.py", line 8, in map_exceptions yield File "~/lib/python3.8/site-packages/httpcore/backends/asyncio.py", line 109, in connect_tcp stream: anyio.abc.ByteStream = await anyio.connect_tcp( File "~/lib/python3.8/site-packages/anyio/_core/_tasks.py", line 118, in exit raise TimeoutError TimeoutError
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "~/lib/python3.8/site-packages/httpx/_transports/default.py", line 60, in map_httpcore_exceptions yield File "~/lib/python3.8/site-packages/httpx/_transports/default.py", line 353, in handle_async_request resp = await self._pool.handle_async_request(req) File "~/lib/python3.8/site-packages/httpcore/_async/connection_pool.py", line 253, in handle_async_request raise exc File "~/lib/python3.8/site-packages/httpcore/_async/connection_pool.py", line 237, in handle_async_request response = await connection.handle_async_request(request) File "~/lib/python3.8/site-packages/httpcore/_async/connection.py", line 86, in handle_async_request raise exc File "~/lib/python3.8/site-packages/httpcore/_async/connection.py", line 63, in handle_async_request stream = await self._connect(request) File "~/lib/python3.8/site-packages/httpcore/_async/connection.py", line 111, in _connect stream = await self._network_backend.connect_tcp(**kwargs) File "~/lib/python3.8/site-packages/httpcore/backends/auto.py", line 29, in connect_tcp return await self._backend.connect_tcp( File "~/lib/python3.8/site-packages/httpcore/backends/asyncio.py", line 109, in connect_tcp stream: anyio.abc.ByteStream = await anyio.connect_tcp( File "~/lib/python3.8/contextlib.py", line 131, in exit self.gen.throw(type, value, traceback) File "~/lib/python3.8/site-packages/httpcore/_exceptions.py", line 12, in map_exceptions raise to_exc(exc) httpcore.ConnectTimeout
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "~/bin/nb", line 8, in
File "~/lib/python3.8/site-packages/nonebot/message.py", line 196, in _run_matcher await matcher.run(bot, event, state, stack, dependency_cache) File "~/lib/python3.8/site-packages/nonebot/internal/matcher.py", line 672, in run await self.simple_run(bot, event, state, stack, dependency_cache) File "~/lib/python3.8/site-packages/nonebot/internal/matcher.py", line 639, in simple_run await handler( File "~/lib/python3.8/site-packages/nonebot/dependencies/init.py", line 92, in call return await self.call(**values) File "./src/plugins/nonebot_plugin_smart_replys/init.py", line 67, in _ message = await xiaoice_reply(xiaoai_url) File "./src/plugins/nonebot_plugin_smart_replys/utils.py", line 85, in xiaoice_reply res = (await client.get(url)).text File "~/lib/python3.8/site-packages/httpx/_client.py", line 1751, in get return await self.request( File "~/lib/python3.8/site-packages/httpx/_client.py", line 1527, in request return await self.send(request, auth=auth, follow_redirects=follow_redirects) File "~/lib/python3.8/site-packages/httpx/_client.py", line 1614, in send response = await self._send_handling_auth( File "~/lib/python3.8/site-packages/httpx/_client.py", line 1642, in _send_handling_auth response = await self._send_handling_redirects( File "~/lib/python3.8/site-packages/httpx/_client.py", line 1679, in _send_handling_redirects response = await self._send_single_request(request) File "~/lib/python3.8/site-packages/httpx/_client.py", line 1716, in _send_single_request response = await transport.handle_async_request(request) File "~/lib/python3.8/site-packages/httpx/_transports/default.py", line 353, in handle_async_request resp = await self._pool.handle_async_request(req) File "~/lib/python3.8/contextlib.py", line 131, in exit self.gen.throw(type, value, traceback) File "~/lib/python3.8/site-packages/httpx/_transports/default.py", line 77, in map_httpcore_exceptions raise mapped_exc(message) from exc httpx.ConnectTimeout
好像是小爱同学的api寄了, 你换一下api
好的 我去试试
好的 我去试试