Skip to content

Commit d0998a9

Browse files
committed
fix: remove hard-coded 6s timeout from tavily request
1 parent 3678688 commit d0998a9

File tree

1 file changed

+2
-4
lines changed
  • astrbot/builtin_stars/web_searcher

1 file changed

+2
-4
lines changed

astrbot/builtin_stars/web_searcher/main.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ async def _get_from_url(self, url: str) -> str:
7070
header = HEADERS
7171
header.update({"User-Agent": random.choice(USER_AGENTS)})
7272
async with aiohttp.ClientSession(trust_env=True) as session:
73-
async with session.get(url, headers=header, timeout=6) as response:
73+
async with session.get(url, headers=header) as response:
7474
html = await response.text(encoding="utf-8")
7575
doc = Document(html)
7676
ret = doc.summary(html_partial=True)
@@ -151,7 +151,6 @@ async def _web_search_tavily(
151151
url,
152152
json=payload,
153153
headers=header,
154-
timeout=6,
155154
) as response:
156155
if response.status != 200:
157156
reason = await response.text()
@@ -183,7 +182,6 @@ async def _extract_tavily(self, cfg: AstrBotConfig, payload: dict) -> list[dict]
183182
url,
184183
json=payload,
185184
headers=header,
186-
timeout=6,
187185
) as response:
188186
if response.status != 200:
189187
reason = await response.text()
@@ -265,7 +263,7 @@ async def ensure_baidu_ai_search_mcp(self, umo: str | None = None) -> None:
265263
"transport": "sse",
266264
"url": f"http://appbuilder.baidu.com/v2/ai_search/mcp/sse?api_key={key}",
267265
"headers": {},
268-
"timeout": 30,
266+
"timeout": 600,
269267
},
270268
)
271269
self.baidu_initialized = True

0 commit comments

Comments
 (0)