summaryrefslogtreecommitdiffstats
path: root/g4f/Provider/FlowGpt.py
diff options
context:
space:
mode:
authorH Lohaus <hlohaus@users.noreply.github.com>2024-04-06 23:33:22 +0200
committerGitHub <noreply@github.com>2024-04-06 23:33:22 +0200
commitae8dd4048ce808f95dda3310453fb806cf02e33e (patch)
treeee0098bf175d67d93f9dd34f00d8e6939443ee01 /g4f/Provider/FlowGpt.py
parentUpdate FreeGpt.py (diff)
downloadgpt4free-ae8dd4048ce808f95dda3310453fb806cf02e33e.tar
gpt4free-ae8dd4048ce808f95dda3310453fb806cf02e33e.tar.gz
gpt4free-ae8dd4048ce808f95dda3310453fb806cf02e33e.tar.bz2
gpt4free-ae8dd4048ce808f95dda3310453fb806cf02e33e.tar.lz
gpt4free-ae8dd4048ce808f95dda3310453fb806cf02e33e.tar.xz
gpt4free-ae8dd4048ce808f95dda3310453fb806cf02e33e.tar.zst
gpt4free-ae8dd4048ce808f95dda3310453fb806cf02e33e.zip
Diffstat (limited to 'g4f/Provider/FlowGpt.py')
-rw-r--r--g4f/Provider/FlowGpt.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/g4f/Provider/FlowGpt.py b/g4f/Provider/FlowGpt.py
index d84bd81d..dc5c6d8d 100644
--- a/g4f/Provider/FlowGpt.py
+++ b/g4f/Provider/FlowGpt.py
@@ -5,7 +5,7 @@ from aiohttp import ClientSession
from ..typing import AsyncResult, Messages
from .base_provider import AsyncGeneratorProvider, ProviderModelMixin
-from ..errors import RateLimitError
+from ..requests.raise_for_status import raise_for_status
class FlowGpt(AsyncGeneratorProvider, ProviderModelMixin):
url = "https://flowgpt.com/chat"
@@ -70,9 +70,7 @@ class FlowGpt(AsyncGeneratorProvider, ProviderModelMixin):
"generateAudio": False
}
async with session.post("https://backend-k8s.flowgpt.com/v2/chat-anonymous", json=data, proxy=proxy) as response:
- if response.status == 429:
- raise RateLimitError("Rate limit reached")
- response.raise_for_status()
+ await raise_for_status(response)
async for chunk in response.content:
if chunk.strip():
message = json.loads(chunk)