diff options
author | H Lohaus <hlohaus@users.noreply.github.com> | 2024-05-20 01:50:03 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-20 01:50:03 +0200 |
commit | 5115cf0e23e9abf2860161794a10e3a40055af4d (patch) | |
tree | 47c2a9f631c0ff4e47d8f34906705771164920b2 /g4f/Provider/needs_auth/Gemini.py | |
parent | Update DeepInfra.py (diff) | |
parent | Add some options to messages in gui, saves generated images local (diff) | |
download | gpt4free-5115cf0e23e9abf2860161794a10e3a40055af4d.tar gpt4free-5115cf0e23e9abf2860161794a10e3a40055af4d.tar.gz gpt4free-5115cf0e23e9abf2860161794a10e3a40055af4d.tar.bz2 gpt4free-5115cf0e23e9abf2860161794a10e3a40055af4d.tar.lz gpt4free-5115cf0e23e9abf2860161794a10e3a40055af4d.tar.xz gpt4free-5115cf0e23e9abf2860161794a10e3a40055af4d.tar.zst gpt4free-5115cf0e23e9abf2860161794a10e3a40055af4d.zip |
Diffstat (limited to '')
-rw-r--r-- | g4f/Provider/needs_auth/Gemini.py | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/g4f/Provider/needs_auth/Gemini.py b/g4f/Provider/needs_auth/Gemini.py index f9b1c4a5..71cc8d81 100644 --- a/g4f/Provider/needs_auth/Gemini.py +++ b/g4f/Provider/needs_auth/Gemini.py @@ -4,7 +4,6 @@ import os import json import random import re -import base64 from aiohttp import ClientSession, BaseConnector @@ -193,14 +192,10 @@ class Gemini(AsyncGeneratorProvider): yield content if image_prompt: images = [image[0][3][3] for image in response_part[4][0][12][7][0]] - resolved_images = [] if response_format == "b64_json": - for image in images: - async with client.get(image) as response: - data = base64.b64encode(await response.content.read()).decode() - resolved_images.append(data) - yield ImageDataResponse(resolved_images, image_prompt) + yield ImageResponse(images, image_prompt, {"cookies": cls._cookies}) else: + resolved_images = [] preview = [] for image in images: async with client.get(image, allow_redirects=False) as fetch: |