AstrBot icon indicating copy to clipboard operation
AstrBot copied to clipboard

[Bug]网页搜索tavily无法使用

Open siciyuanweilai opened this issue 1 year ago • 1 comments

发生了什么

如题

如何复现?

发送“今天有什么大新闻”报错,之后Astrbot就会停止无响应。

AstrBot 版本、部署方式(如 Windows Docker Desktop 部署)、使用的提供商、使用的消息平台适配器

AstrBot 版本:v4.1.7 部署方式:Windows 使用的提供商:Gemini Pro 2.5 使用的消息平台适配器:aiocqhttp

操作系统

Windows

报错日志

[10:50:27] [Core] [INFO] [core.event_bus:52]: [default] [昵称(aiocqhttp)] 昵称/12345678: 今天有什么大新闻
[10:50:29] [Core] [INFO] [astrbot_plugin_livingmemory.main:179]: [90a650cc-351e-4421-8c4e-27f13838ed0e] 成功向 System Prompt 注入 5 条记忆。 [10:50:38] [Core] [INFO] [respond.stage:161]: Prepare to send - 昵称/12345678:
[10:50:38] [Core] [INFO] [respond.stage:188]: 消息为空,跳过发送阶段 [10:50:38] [Core] [INFO] [runners.tool_loop_agent_runner:187]: Agent 使用工具: ['web_search_tavily'] [10:50:38] [Core] [INFO] [runners.tool_loop_agent_runner:199]: 使用工具:web_search_tavily,参数:{'query': '今日头条新闻', 'topic': 'news'} [10:50:38] [Core] [INFO] [web_searcher.main:259]: web_searcher - search_from_tavily: 今日头条新闻 [10:50:39] [Core] [WARN] [runners.tool_loop_agent_runner:295]: Traceback (most recent call last): File "D:\AstrBotLauncher-0.1.5.6\AstrBot\venv\Lib\site-packages\aiohttp\connector.py", line 1432, in _start_tls_connection tls_transport = await self._loop.start_tls( ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ...<5 lines>... ) ^ File "C:\Users\Administrator\AppData\Local\Programs\Python\Python313\Lib\asyncio\base_events.py", line 1356, in start_tls await waiter File "C:\Users\Administrator\AppData\Local\Programs\Python\Python313\Lib\asyncio\sslproto.py", line 581, in _on_handshake_complete raise handshake_exc File "C:\Users\Administrator\AppData\Local\Programs\Python\Python313\Lib\asyncio\sslproto.py", line 563, in _do_handshake self._sslobj.do_handshake() ~~~~~~~~~~~~~~~~~~~~~~~~~^^ File "C:\Users\Administrator\AppData\Local\Programs\Python\Python313\Lib\ssl.py", line 951, in do_handshake self._sslobj.do_handshake() ~~~~~~~~~~~~~~~~~~~~~~~~~^^ ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1032)

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "D:\AstrBotLauncher-0.1.5.6\AstrBot\astrbot\core\agent\runners\tool_loop_agent_runner.py", line 213, in _handle_function_tools async for resp in executor: ...<70 lines>... ) File "D:\AstrBotLauncher-0.1.5.6\AstrBot\astrbot\core\pipeline\process_stage\method\llm_request.py", line 67, in execute async for r in cls._execute_local(tool, run_context, **tool_args): yield r File "D:\AstrBotLauncher-0.1.5.6\AstrBot\astrbot\core\pipeline\process_stage\method\llm_request.py", line 188, in _execute_local async for resp in wrapper: ...<13 lines>... yield None File "D:\AstrBotLauncher-0.1.5.6\AstrBot\astrbot\core\pipeline\context_utils.py", line 65, in call_handler ret = await ready_to_call ^^^^^^^^^^^^^^^^^^^ File "D:\AstrBotLauncher-0.1.5.6\AstrBot\packages\web_searcher\main.py", line 288, in search_from_tavily results = await self._web_search_tavily(cfg, payload) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\AstrBotLauncher-0.1.5.6\AstrBot\packages\web_searcher\main.py", line 136, in _web_search_tavily async with session.post( ~~~~~~~~~~~~^ url, json=payload, headers=header, timeout=6 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ) as response: ^ File "D:\AstrBotLauncher-0.1.5.6\AstrBot\venv\Lib\site-packages\aiohttp\client.py", line 1488, in aenter self._resp: _RetType = await self._coro ^^^^^^^^^^^^^^^^ File "D:\AstrBotLauncher-0.1.5.6\AstrBot\venv\Lib\site-packages\aiohttp\client.py", line 770, in _request resp = await handler(req) ^^^^^^^^^^^^^^^^^^ File "D:\AstrBotLauncher-0.1.5.6\AstrBot\venv\Lib\site-packages\aiohttp\client.py", line 725, in _connect_and_send_request conn = await self._connector.connect( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ req, traces=traces, timeout=real_timeout ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ) ^ File "D:\AstrBotLauncher-0.1.5.6\AstrBot\venv\Lib\site-packages\aiohttp\connector.py", line 642, in connect proto = await self._create_connection(req, traces, timeout) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\AstrBotLauncher-0.1.5.6\AstrBot\venv\Lib\site-packages\aiohttp\connector.py", line 1207, in _create_connection _, proto = await self._create_proxy_connection(req, traces, timeout) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\AstrBotLauncher-0.1.5.6\AstrBot\venv\Lib\site-packages\aiohttp\connector.py", line 1697, in _create_proxy_connection return await self._start_tls_connection( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ...<5 lines>... ) ^ File "D:\AstrBotLauncher-0.1.5.6\AstrBot\venv\Lib\site-packages\aiohttp\connector.py", line 1459, in _start_tls_connection raise ClientConnectorCertificateError(req.connection_key, exc) from exc aiohttp.client_exceptions.ClientConnectorCertificateError: Cannot connect to host api.tavily.com:443 ssl:True [SSLCertVerificationError: (5, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1032)')]

你愿意提交 PR 吗?

  • [ ] 是的,我愿意提交 PR!

Code of Conduct

  • [x] 我已阅读并同意遵守该项目的 行为准则。

siciyuanweilai avatar Sep 27 '25 03:09 siciyuanweilai

换了Linux服务器,已解决

siciyuanweilai avatar Oct 02 '25 12:10 siciyuanweilai