diff options
author | H Lohaus <hlohaus@users.noreply.github.com> | 2024-01-24 01:05:29 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-24 01:05:29 +0100 |
commit | 71d71b6512df12d6295c1f8323eb056edd89c57f (patch) | |
tree | db88f2c8237b51519401e077df059b71f41e6404 /g4f/Provider/Liaobots.py | |
parent | Merge pull request #1509 from hlohaus/sort (diff) | |
parent | Add get_connector helper (diff) | |
download | gpt4free-0.2.0.5.tar gpt4free-0.2.0.5.tar.gz gpt4free-0.2.0.5.tar.bz2 gpt4free-0.2.0.5.tar.lz gpt4free-0.2.0.5.tar.xz gpt4free-0.2.0.5.tar.zst gpt4free-0.2.0.5.zip |
Diffstat (limited to 'g4f/Provider/Liaobots.py')
-rw-r--r-- | g4f/Provider/Liaobots.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/g4f/Provider/Liaobots.py b/g4f/Provider/Liaobots.py index 5151c115..e93642ba 100644 --- a/g4f/Provider/Liaobots.py +++ b/g4f/Provider/Liaobots.py @@ -2,10 +2,11 @@ from __future__ import annotations import uuid -from aiohttp import ClientSession +from aiohttp import ClientSession, BaseConnector from ..typing import AsyncResult, Messages from .base_provider import AsyncGeneratorProvider, ProviderModelMixin +from .helper import get_connector models = { "gpt-4": { @@ -91,6 +92,7 @@ class Liaobots(AsyncGeneratorProvider, ProviderModelMixin): messages: Messages, auth: str = None, proxy: str = None, + connector: BaseConnector = None, **kwargs ) -> AsyncResult: headers = { @@ -102,7 +104,8 @@ class Liaobots(AsyncGeneratorProvider, ProviderModelMixin): } async with ClientSession( headers=headers, - cookie_jar=cls._cookie_jar + cookie_jar=cls._cookie_jar, + connector=get_connector(connector, proxy) ) as session: cls._auth_code = auth if isinstance(auth, str) else cls._auth_code if not cls._auth_code: |