summaryrefslogtreecommitdiffstats
path: root/g4f
diff options
context:
space:
mode:
authorHeiner Lohaus <hlohaus@users.noreply.github.com>2024-03-08 10:12:13 +0100
committerHeiner Lohaus <hlohaus@users.noreply.github.com>2024-03-08 10:12:13 +0100
commiteb48299195805bbcba30275a2bf857955e1287ec (patch)
tree95fbff81997bdab9a52593776ccbbd89a6420817 /g4f
parentMerge pull request #1663 from ramonvc/main (diff)
downloadgpt4free-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 'g4f')
-rw-r--r--g4f/Provider/FlowGpt.py2
-rw-r--r--g4f/Provider/Liaobots.py5
-rw-r--r--g4f/Provider/__init__.py1
-rw-r--r--g4f/Provider/deprecated/Phind.py (renamed from g4f/Provider/Phind.py)9
-rw-r--r--g4f/Provider/deprecated/__init__.py3
-rw-r--r--g4f/errors.py3
-rw-r--r--g4f/gui/client/html/index.html1
7 files changed, 14 insertions, 10 deletions
diff --git a/g4f/Provider/FlowGpt.py b/g4f/Provider/FlowGpt.py
index b466a2e6..93e7955c 100644
--- a/g4f/Provider/FlowGpt.py
+++ b/g4f/Provider/FlowGpt.py
@@ -10,11 +10,9 @@ class FlowGpt(AsyncGeneratorProvider, ProviderModelMixin):
url = "https://flowgpt.com/chat"
working = True
supports_gpt_35_turbo = True
- supports_gpt_4 = True
supports_message_history = True
default_model = "gpt-3.5-turbo"
models = [
- "gpt-4",
"gpt-3.5-turbo",
"gpt-3.5-long",
"google-gemini",
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
diff --git a/g4f/Provider/__init__.py b/g4f/Provider/__init__.py
index 52ba0274..7832f871 100644
--- a/g4f/Provider/__init__.py
+++ b/g4f/Provider/__init__.py
@@ -51,7 +51,6 @@ from .Liaobots import Liaobots
from .Llama2 import Llama2
from .OnlineGpt import OnlineGpt
from .PerplexityLabs import PerplexityLabs
-from .Phind import Phind
from .Pi import Pi
from .Vercel import Vercel
from .Ylokh import Ylokh
diff --git a/g4f/Provider/Phind.py b/g4f/Provider/deprecated/Phind.py
index 096cdd29..c72bf09e 100644
--- a/g4f/Provider/Phind.py
+++ b/g4f/Provider/deprecated/Phind.py
@@ -5,13 +5,14 @@ import json
from urllib import parse
from datetime import datetime
-from ..typing import AsyncResult, Messages
-from .base_provider import AsyncGeneratorProvider
-from ..requests import StreamSession
+from ...typing import AsyncResult, Messages
+from ..base_provider import AsyncGeneratorProvider
+from ...requests import StreamSession
class Phind(AsyncGeneratorProvider):
url = "https://www.phind.com"
- working = True
+ working = False
+ lockdown = True
supports_stream = True
supports_message_history = True
diff --git a/g4f/Provider/deprecated/__init__.py b/g4f/Provider/deprecated/__init__.py
index 4d7eb5da..8ec5f2fc 100644
--- a/g4f/Provider/deprecated/__init__.py
+++ b/g4f/Provider/deprecated/__init__.py
@@ -22,4 +22,5 @@ from .Cromicle import Cromicle
from .Opchatgpts import Opchatgpts
from .Yqcloud import Yqcloud
from .Aichat import Aichat
-from .Berlin import Berlin \ No newline at end of file
+from .Berlin import Berlin
+from .Phind import Phind \ No newline at end of file
diff --git a/g4f/errors.py b/g4f/errors.py
index 5e821ded..00cf8cdb 100644
--- a/g4f/errors.py
+++ b/g4f/errors.py
@@ -35,4 +35,7 @@ class MissingAuthError(Exception):
...
class NoImageResponseError(Exception):
+ ...
+
+class RateLimitError(Exception):
... \ No newline at end of file
diff --git a/g4f/gui/client/html/index.html b/g4f/gui/client/html/index.html
index 887562c2..86ab157d 100644
--- a/g4f/gui/client/html/index.html
+++ b/g4f/gui/client/html/index.html
@@ -183,7 +183,6 @@
<option value="OpenaiChat">OpenaiChat</option>
<option value="Gemini">Gemini</option>
<option value="Liaobots">Liaobots</option>
- <option value="Phind">Phind</option>
<option value="You">You</option>
<option value="">----</option>
</select>