summaryrefslogtreecommitdiffstats
path: root/g4f/Provider/Bing.py
diff options
context:
space:
mode:
authorHeiner Lohaus <hlohaus@users.noreply.github.com>2024-01-29 18:14:46 +0100
committerHeiner Lohaus <hlohaus@users.noreply.github.com>2024-01-29 18:14:46 +0100
commita28bab938704a15c825c1b45a8983c72e8c90ace (patch)
tree0a3ee26bb1f9e7bf7c1a5a739ed59015248acbfb /g4f/Provider/Bing.py
parentMerge pull request #1523 from u66u/which-webdriver (diff)
downloadgpt4free-a28bab938704a15c825c1b45a8983c72e8c90ace.tar
gpt4free-a28bab938704a15c825c1b45a8983c72e8c90ace.tar.gz
gpt4free-a28bab938704a15c825c1b45a8983c72e8c90ace.tar.bz2
gpt4free-a28bab938704a15c825c1b45a8983c72e8c90ace.tar.lz
gpt4free-a28bab938704a15c825c1b45a8983c72e8c90ace.tar.xz
gpt4free-a28bab938704a15c825c1b45a8983c72e8c90ace.tar.zst
gpt4free-a28bab938704a15c825c1b45a8983c72e8c90ace.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