diff options
author | Heiner Lohaus <hlohaus@users.noreply.github.com> | 2024-03-08 10:12:13 +0100 |
---|---|---|
committer | Heiner Lohaus <hlohaus@users.noreply.github.com> | 2024-03-08 10:12:13 +0100 |
commit | eb48299195805bbcba30275a2bf857955e1287ec (patch) | |
tree | 95fbff81997bdab9a52593776ccbbd89a6420817 /g4f/Provider/Liaobots.py | |
parent | Merge pull request #1663 from ramonvc/main (diff) | |
download | gpt4free-eb48299195805bbcba30275a2bf857955e1287ec.tar gpt4free-eb48299195805bbcba30275a2bf857955e1287ec.tar.gz gpt4free-eb48299195805bbcba30275a2bf857955e1287ec.tar.bz2 gpt4free-eb48299195805bbcba30275a2bf857955e1287ec.tar.lz gpt4free-eb48299195805bbcba30275a2bf857955e1287ec.tar.xz gpt4free-eb48299195805bbcba30275a2bf857955e1287ec.tar.zst gpt4free-eb48299195805bbcba30275a2bf857955e1287ec.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 |