diff options
author | Heiner Lohaus <hlohaus@users.noreply.github.com> | 2024-04-10 14:23:30 +0200 |
---|---|---|
committer | Heiner Lohaus <hlohaus@users.noreply.github.com> | 2024-04-10 14:23:30 +0200 |
commit | 65bcc8ae8bfc435b302be7cad0f4f87961154646 (patch) | |
tree | 0f65dde345aa2b6d0d87b5caf78169b6357761e1 /g4f/requests/aiohttp.py | |
parent | Add OpenRouter and DeepInfraImage Provider (#1814) (diff) | |
download | gpt4free-65bcc8ae8bfc435b302be7cad0f4f87961154646.tar gpt4free-65bcc8ae8bfc435b302be7cad0f4f87961154646.tar.gz gpt4free-65bcc8ae8bfc435b302be7cad0f4f87961154646.tar.bz2 gpt4free-65bcc8ae8bfc435b302be7cad0f4f87961154646.tar.lz gpt4free-65bcc8ae8bfc435b302be7cad0f4f87961154646.tar.xz gpt4free-65bcc8ae8bfc435b302be7cad0f4f87961154646.tar.zst gpt4free-65bcc8ae8bfc435b302be7cad0f4f87961154646.zip |
Diffstat (limited to 'g4f/requests/aiohttp.py')
-rw-r--r-- | g4f/requests/aiohttp.py | 7 |
1 files changed, 6 insertions, 1 deletions
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 |