diff options
author | H Lohaus <hlohaus@users.noreply.github.com> | 2024-03-08 10:15:26 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-08 10:15:26 +0100 |
commit | d1a8164547a6a733f90588ed3700479cf04920f3 (patch) | |
tree | 95fbff81997bdab9a52593776ccbbd89a6420817 /g4f/Provider/Liaobots.py | |
parent | Merge pull request #1663 from ramonvc/main (diff) | |
parent | Enable Liaobots, disable Phind provider (diff) | |
download | gpt4free-d1a8164547a6a733f90588ed3700479cf04920f3.tar gpt4free-d1a8164547a6a733f90588ed3700479cf04920f3.tar.gz gpt4free-d1a8164547a6a733f90588ed3700479cf04920f3.tar.bz2 gpt4free-d1a8164547a6a733f90588ed3700479cf04920f3.tar.lz gpt4free-d1a8164547a6a733f90588ed3700479cf04920f3.tar.xz gpt4free-d1a8164547a6a733f90588ed3700479cf04920f3.tar.zst gpt4free-d1a8164547a6a733f90588ed3700479cf04920f3.zip |
Diffstat (limited to '')
-rw-r--r-- | g4f/Provider/Liaobots.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/g4f/Provider/Liaobots.py b/g4f/Provider/Liaobots.py index 79e48ace..92154d7d 100644 --- a/g4f/Provider/Liaobots.py +++ b/g4f/Provider/Liaobots.py @@ -7,6 +7,7 @@ from aiohttp import ClientSession, BaseConnector from ..typing import AsyncResult, Messages from .base_provider import AsyncGeneratorProvider, ProviderModelMixin from .helper import get_connector +from ..errors import RateLimitError models = { "gpt-4": { @@ -73,7 +74,7 @@ models = { class Liaobots(AsyncGeneratorProvider, ProviderModelMixin): url = "https://liaobots.site" - working = False + working = True supports_message_history = True supports_gpt_35_turbo = True supports_gpt_4 = True @@ -122,6 +123,8 @@ class Liaobots(AsyncGeneratorProvider, ProviderModelMixin): json={"authcode": ""}, verify_ssl=False ) as response: + if response.status == 401: + raise RateLimitError("Rate limit reached. Use a other provider or ip address") response.raise_for_status() cls._auth_code = (await response.json(content_type=None))["authCode"] cls._cookie_jar = session.cookie_jar |