diff --git a/src/langbot/pkg/utils/image.py b/src/langbot/pkg/utils/image.py index d9518e12..e07caec6 100644 --- a/src/langbot/pkg/utils/image.py +++ b/src/langbot/pkg/utils/image.py @@ -153,7 +153,9 @@ async def get_qq_image_bytes(image_url: str, query: dict = {}) -> tuple[bytes, s ssl_context.check_hostname = False ssl_context.verify_mode = ssl.CERT_NONE async with aiohttp.ClientSession(trust_env=False) as session: - async with session.get(image_url, params=query, ssl=ssl_context) as resp: + async with session.get( + image_url, params=query, ssl=ssl_context, timeout=aiohttp.ClientTimeout(total=30.0) + ) as resp: resp.raise_for_status() file_bytes = await resp.read() content_type = resp.headers.get('Content-Type')