From ceed364cb1ade47a29ccf698074be01b520fc82c Mon Sep 17 00:00:00 2001 From: Heiner Lohaus Date: Sat, 13 Jan 2024 18:10:43 +0100 Subject: Fix process_image in Bing Add ImageResponse to Bing Fix cursor styling in gui --- g4f/Provider/needs_auth/OpenaiChat.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'g4f/Provider/needs_auth') 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 -- cgit v1.2.3