summaryrefslogtreecommitdiffstats
path: root/g4f/Provider/FreeChatgpt.py
diff options
context:
space:
mode:
authorH Lohaus <hlohaus@users.noreply.github.com>2024-04-06 23:50:17 +0200
committerGitHub <noreply@github.com>2024-04-06 23:50:17 +0200
commitc85765925fe9a72ae268bf78ff1cd9437af4d45e (patch)
tree91b74c3b0e8db1505b05483e958ebdeb77c49619 /g4f/Provider/FreeChatgpt.py
parentUpdate DeepInfra.py (diff)
downloadgpt4free-c85765925fe9a72ae268bf78ff1cd9437af4d45e.tar
gpt4free-c85765925fe9a72ae268bf78ff1cd9437af4d45e.tar.gz
gpt4free-c85765925fe9a72ae268bf78ff1cd9437af4d45e.tar.bz2
gpt4free-c85765925fe9a72ae268bf78ff1cd9437af4d45e.tar.lz
gpt4free-c85765925fe9a72ae268bf78ff1cd9437af4d45e.tar.xz
gpt4free-c85765925fe9a72ae268bf78ff1cd9437af4d45e.tar.zst
gpt4free-c85765925fe9a72ae268bf78ff1cd9437af4d45e.zip
Diffstat (limited to '')
-rw-r--r--g4f/Provider/FreeChatgpt.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/g4f/Provider/FreeChatgpt.py b/g4f/Provider/FreeChatgpt.py
index c20c85d2..3fb247c7 100644
--- a/g4f/Provider/FreeChatgpt.py
+++ b/g4f/Provider/FreeChatgpt.py
@@ -5,6 +5,7 @@ from aiohttp import ClientSession, ClientTimeout
from ..typing import AsyncResult, Messages
from .base_provider import AsyncGeneratorProvider, ProviderModelMixin
+from ..requests.raise_for_status import raise_for_status
class FreeChatgpt(AsyncGeneratorProvider, ProviderModelMixin):
url = "https://free.chatgpt.org.uk"
@@ -45,7 +46,7 @@ class FreeChatgpt(AsyncGeneratorProvider, ProviderModelMixin):
"top_p": kwargs.get("top_p", 1)
}
async with session.post(f'{cls.url}/api/openai/v1/chat/completions', json=data, proxy=proxy) as response:
- response.raise_for_status()
+ await raise_for_status(response)
started = False
async for line in response.content:
if line.startswith(b"data: [DONE]"):