From ae8dd4048ce808f95dda3310453fb806cf02e33e Mon Sep 17 00:00:00 2001 From: H Lohaus Date: Sat, 6 Apr 2024 23:33:22 +0200 Subject: Update FlowGpt.py --- g4f/Provider/FlowGpt.py | 6 ++---- 1 file 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) -- cgit v1.2.3