From 65bcc8ae8bfc435b302be7cad0f4f87961154646 Mon Sep 17 00:00:00 2001 From: Heiner Lohaus Date: Wed, 10 Apr 2024 14:23:30 +0200 Subject: Some small fixes --- g4f/requests/aiohttp.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'g4f/requests/aiohttp.py') diff --git a/g4f/requests/aiohttp.py b/g4f/requests/aiohttp.py index 71e7bde7..cdbedef3 100644 --- a/g4f/requests/aiohttp.py +++ b/g4f/requests/aiohttp.py @@ -33,9 +33,14 @@ class StreamSession(ClientSession): **DEFAULT_HEADERS, **headers } + connect = None + if isinstance(timeout, tuple): + connect, timeout = timeout; + if timeout is not None: + timeout = ClientTimeout(timeout, connect) super().__init__( **kwargs, - timeout=ClientTimeout(timeout) if timeout else None, + timeout=timeout, response_class=StreamResponse, connector=get_connector(connector, proxies.get("all", proxies.get("https"))), headers=headers -- cgit v1.2.3