From c32c676b5baa68e9abab4e3e704be55a31521bdd Mon Sep 17 00:00:00 2001 From: Ammar Date: Thu, 27 Nov 2025 09:21:13 +0200 Subject: [PATCH] Update OpenaiChat.py fix error --- g4f/Provider/needs_auth/OpenaiChat.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/g4f/Provider/needs_auth/OpenaiChat.py b/g4f/Provider/needs_auth/OpenaiChat.py index 740c7c50..6e8b51f5 100644 --- a/g4f/Provider/needs_auth/OpenaiChat.py +++ b/g4f/Provider/needs_auth/OpenaiChat.py @@ -162,7 +162,7 @@ class OpenaiChat(AsyncAuthedProvider, ProviderModelMixin): hasher.update(data_bytes) image_hash = hasher.hexdigest() cache_file = ImagesCache.get(image_hash) - if cls.image_cache and file: + if cls.image_cache and cache_file: debug.log("Using cached image") return ImageRequest(cache_file) extension, mime_type = detect_file_type(data_bytes)