summaryrefslogtreecommitdiffstats
path: root/g4f/Provider/needs_auth/OpenaiChat.py
diff options
context:
space:
mode:
authorHeiner Lohaus <hlohaus@users.noreply.github.com>2024-01-13 18:10:43 +0100
committerHeiner Lohaus <hlohaus@users.noreply.github.com>2024-01-13 18:10:43 +0100
commitceed364cb1ade47a29ccf698074be01b520fc82c (patch)
treefd1ddf447d186ee5e4c8977e5b937e4161392b4c /g4f/Provider/needs_auth/OpenaiChat.py
parentImprove FreeChatgpt Provider (diff)
downloadgpt4free-ceed364cb1ade47a29ccf698074be01b520fc82c.tar
gpt4free-ceed364cb1ade47a29ccf698074be01b520fc82c.tar.gz
gpt4free-ceed364cb1ade47a29ccf698074be01b520fc82c.tar.bz2
gpt4free-ceed364cb1ade47a29ccf698074be01b520fc82c.tar.lz
gpt4free-ceed364cb1ade47a29ccf698074be01b520fc82c.tar.xz
gpt4free-ceed364cb1ade47a29ccf698074be01b520fc82c.tar.zst
gpt4free-ceed364cb1ade47a29ccf698074be01b520fc82c.zip
Diffstat (limited to 'g4f/Provider/needs_auth/OpenaiChat.py')
-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