summaryrefslogtreecommitdiffstats
path: root/g4f/Provider/Bing.py
diff options
context:
space:
mode:
authorH Lohaus <hlohaus@users.noreply.github.com>2024-01-29 20:37:59 +0100
committerGitHub <noreply@github.com>2024-01-29 20:37:59 +0100
commit280ddf57b0f54d1805f1ee26aa699469019e731f (patch)
treecabcbf5fa9a5dbf75a223377dbf032cfeb3e1027 /g4f/Provider/Bing.py
parentMerge pull request #1523 from u66u/which-webdriver (diff)
parentImprove readme / unittests (diff)
downloadgpt4free-280ddf57b0f54d1805f1ee26aa699469019e731f.tar
gpt4free-280ddf57b0f54d1805f1ee26aa699469019e731f.tar.gz
gpt4free-280ddf57b0f54d1805f1ee26aa699469019e731f.tar.bz2
gpt4free-280ddf57b0f54d1805f1ee26aa699469019e731f.tar.lz
gpt4free-280ddf57b0f54d1805f1ee26aa699469019e731f.tar.xz
gpt4free-280ddf57b0f54d1805f1ee26aa699469019e731f.tar.zst
gpt4free-280ddf57b0f54d1805f1ee26aa699469019e731f.zip
Diffstat (limited to 'g4f/Provider/Bing.py')
-rw-r--r--g4f/Provider/Bing.py4
1 files changed, 1 insertions, 3 deletions
diff --git a/g4f/Provider/Bing.py b/g4f/Provider/Bing.py
index 32879fa6..40a42bf5 100644
--- a/g4f/Provider/Bing.py
+++ b/g4f/Provider/Bing.py
@@ -288,8 +288,6 @@ async def stream_generate(
) as session:
conversation = await create_conversation(session)
image_request = await upload_image(session, image, tone) if image else None
- if image_request:
- yield image_request
try:
async with session.ws_connect(
@@ -327,7 +325,7 @@ async def stream_generate(
elif message.get('contentType') == "IMAGE":
prompt = message.get('text')
try:
- image_response = ImageResponse(await create_images(session, prompt), prompt)
+ image_response = ImageResponse(await create_images(session, prompt), prompt, {"preview": "{image}?w=200&h=200"})
except:
response_txt += f"\nhttps://www.bing.com/images/create?q={parse.quote(prompt)}"
final = True