summaryrefslogtreecommitdiffstats
path: root/g4f/Provider/Bing.py
diff options
context:
space:
mode:
authorHeiner Lohaus <hlohaus@users.noreply.github.com>2024-03-15 11:46:06 +0100
committerHeiner Lohaus <hlohaus@users.noreply.github.com>2024-03-15 11:46:06 +0100
commit8cc6000ffbf4e12bf6c1d5e5878d376e36857ec0 (patch)
treeea190c7017d8e8982e63a502da0a828d5ba42f94 /g4f/Provider/Bing.py
parentAdd export / import conversations (diff)
downloadgpt4free-8cc6000ffbf4e12bf6c1d5e5878d376e36857ec0.tar
gpt4free-8cc6000ffbf4e12bf6c1d5e5878d376e36857ec0.tar.gz
gpt4free-8cc6000ffbf4e12bf6c1d5e5878d376e36857ec0.tar.bz2
gpt4free-8cc6000ffbf4e12bf6c1d5e5878d376e36857ec0.tar.lz
gpt4free-8cc6000ffbf4e12bf6c1d5e5878d376e36857ec0.tar.xz
gpt4free-8cc6000ffbf4e12bf6c1d5e5878d376e36857ec0.tar.zst
gpt4free-8cc6000ffbf4e12bf6c1d5e5878d376e36857ec0.zip
Diffstat (limited to '')
-rw-r--r--g4f/Provider/Bing.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/g4f/Provider/Bing.py b/g4f/Provider/Bing.py
index f8b13020..925dae0a 100644
--- a/g4f/Provider/Bing.py
+++ b/g4f/Provider/Bing.py
@@ -406,14 +406,13 @@ async def stream_generate(
except Exception as e:
if debug.logging:
print(f"Bing: Failed to create images: {e}")
- response_txt += f"\nhttps://www.bing.com/images/create?q={parse.quote(prompt)}"
- do_read = False
+ image_response = f"\nhttps://www.bing.com/images/create?q={parse.quote(prompt)}"
if response_txt.startswith(returned_text):
new = response_txt[len(returned_text):]
if new not in ("", "\n"):
yield new
returned_text = response_txt
- if image_response:
+ if image_response is not None:
yield image_response
elif response.get('type') == 2:
result = response['item']['result']