summaryrefslogtreecommitdiffstats
path: root/g4f/Provider/needs_auth/Gemini.py
diff options
context:
space:
mode:
authorHeiner Lohaus <hlohaus@users.noreply.github.com>2024-02-11 09:26:02 +0100
committerHeiner Lohaus <hlohaus@users.noreply.github.com>2024-02-11 09:26:02 +0100
commit9aeae65b9b0e7322f63186c0df061de06ca642ee (patch)
treea2436c8874e24e95dbb9d821b6d461cc3d2f3100 /g4f/Provider/needs_auth/Gemini.py
parentChange python version to 3.12 in unitests (diff)
downloadgpt4free-9aeae65b9b0e7322f63186c0df061de06ca642ee.tar
gpt4free-9aeae65b9b0e7322f63186c0df061de06ca642ee.tar.gz
gpt4free-9aeae65b9b0e7322f63186c0df061de06ca642ee.tar.bz2
gpt4free-9aeae65b9b0e7322f63186c0df061de06ca642ee.tar.lz
gpt4free-9aeae65b9b0e7322f63186c0df061de06ca642ee.tar.xz
gpt4free-9aeae65b9b0e7322f63186c0df061de06ca642ee.tar.zst
gpt4free-9aeae65b9b0e7322f63186c0df061de06ca642ee.zip
Diffstat (limited to '')
-rw-r--r--g4f/Provider/needs_auth/Gemini.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/g4f/Provider/needs_auth/Gemini.py b/g4f/Provider/needs_auth/Gemini.py
index 32510505..0650942e 100644
--- a/g4f/Provider/needs_auth/Gemini.py
+++ b/g4f/Provider/needs_auth/Gemini.py
@@ -142,13 +142,15 @@ class Gemini(AsyncGeneratorProvider):
if image_prompt:
images = [image[0][3][3] for image in response_part[4][0][12][7][0]]
resolved_images = []
+ preview = []
for image in images:
async with session.get(image, allow_redirects=False) as fetch:
image = fetch.headers["location"]
async with session.get(image, allow_redirects=False) as fetch:
image = fetch.headers["location"]
resolved_images.append(image)
- yield ImageResponse(resolved_images, image_prompt, {"orginal_links": images})
+ preview.append(image.replace('=s512', '=s200'))
+ yield ImageResponse(resolved_images, image_prompt, {"orginal_links": images, "preview": preview})
def build_request(
prompt: str,