summaryrefslogtreecommitdiffstats
path: root/g4f/Provider/needs_auth
diff options
context:
space:
mode:
Diffstat (limited to 'g4f/Provider/needs_auth')
-rw-r--r--g4f/Provider/needs_auth/OpenaiChat.py5
1 files changed, 1 insertions, 4 deletions
diff --git a/g4f/Provider/needs_auth/OpenaiChat.py b/g4f/Provider/needs_auth/OpenaiChat.py
index 4b11aeaf..a790f0de 100644
--- a/g4f/Provider/needs_auth/OpenaiChat.py
+++ b/g4f/Provider/needs_auth/OpenaiChat.py
@@ -13,7 +13,6 @@ from ...webdriver import get_browser, get_driver_cookies
from ...typing import AsyncResult, Messages
from ...requests import StreamSession
from ...image import to_image, to_bytes, ImageType, ImageResponse
-from ... import debug
models = {
"gpt-3.5": "text-davinci-002-render-sha",
@@ -242,9 +241,7 @@ class OpenaiChat(AsyncGeneratorProvider):
json=data,
headers={"Accept": "text/event-stream", **headers}
) as response:
- try:
- response.raise_for_status()
- except:
+ if not response.ok:
raise RuntimeError(f"Response {response.status_code}: {await response.text()}")
try:
last_message: int = 0