summaryrefslogtreecommitdiffstats
path: root/g4f/Provider/Liaobots.py
diff options
context:
space:
mode:
Diffstat (limited to 'g4f/Provider/Liaobots.py')
-rw-r--r--g4f/Provider/Liaobots.py5
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