summaryrefslogtreecommitdiffstats
path: root/g4f/Provider/BingCreateImages.py
diff options
context:
space:
mode:
authorH Lohaus <hlohaus@users.noreply.github.com>2024-05-07 07:37:23 +0200
committerGitHub <noreply@github.com>2024-05-07 07:37:23 +0200
commit03e5f10992c5e4de9849f4e68bd4596f87e358c6 (patch)
tree6b78482e97c44e0a53b18aaaa9e33b5e0b0af2ba /g4f/Provider/BingCreateImages.py
parentUpdate Bing.py (diff)
downloadgpt4free-03e5f10992c5e4de9849f4e68bd4596f87e358c6.tar
gpt4free-03e5f10992c5e4de9849f4e68bd4596f87e358c6.tar.gz
gpt4free-03e5f10992c5e4de9849f4e68bd4596f87e358c6.tar.bz2
gpt4free-03e5f10992c5e4de9849f4e68bd4596f87e358c6.tar.lz
gpt4free-03e5f10992c5e4de9849f4e68bd4596f87e358c6.tar.xz
gpt4free-03e5f10992c5e4de9849f4e68bd4596f87e358c6.tar.zst
gpt4free-03e5f10992c5e4de9849f4e68bd4596f87e358c6.zip
Diffstat (limited to '')
-rw-r--r--g4f/Provider/BingCreateImages.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/g4f/Provider/BingCreateImages.py b/g4f/Provider/BingCreateImages.py
index 9e5146cc..79dc5665 100644
--- a/g4f/Provider/BingCreateImages.py
+++ b/g4f/Provider/BingCreateImages.py
@@ -51,7 +51,7 @@ class BingCreateImages(AsyncGeneratorProvider, ProviderModelMixin):
Generator[str, None, None]: The final output as markdown formatted string with images.
"""
cookies = self.cookies or get_cookies(".bing.com", False)
- if "_U" not in cookies:
+ if cookies is None or "_U" not in cookies:
login_url = os.environ.get("G4F_LOGIN_URL")
if login_url:
yield f"Please login: [Bing]({login_url})\n\n"
@@ -72,7 +72,7 @@ class BingCreateImages(AsyncGeneratorProvider, ProviderModelMixin):
str: Markdown formatted string with images.
"""
cookies = self.cookies or get_cookies(".bing.com", False)
- if "_U" not in cookies:
+ if cookies is None or "_U" not in cookies:
raise MissingAuthError('Missing "_U" cookie')
proxy = self.proxy or os.environ.get("G4F_PROXY")
async with create_session(cookies, proxy) as session: