New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The response text is a empty URL, which cannot be seen. {'metadata': ['c_cd648c1c943cb00f', 'r_f093111e78855c35'], 'candidates': {'rcid': 'rc_97ec8a9d7ddbed62', 'text': 'http://googleusercontent.com/card_content/0', 'web_images': [], 'generated_images': []}} #14
Comments
Hello, LuxerIThink This has already been developed and will be updated today. It will be provided as asynchronous code that can save to a bytetype image or path. Thank you for your valuable feedback! |
Getting same error |
Please, try to this code. from gemini import Gemini, GeminiImage
response = GeminiClient.generate_content("Create illustrations of Seoul, South Korea.")
generated_images = response.generated_images # Check generated images [Dict]
GeminiImage.save_sync(generated_images, save_path="cached")
# You can use byte type image dict for printing images as follow:
bytes_images_dict = GeminiImage.fetch_images_dict_sync(generated_images, cookies) # Get bytes images dict
from IPython.display import display, Image
import io
for image_name, image_bytes in bytes_images_dict.items():
print(image_name)
image = Image(data=image_bytes)
display(image)
# GeminiImage.save_images_sync(bytes_images_dict, path="cached") # Save to path |
Code you give us in here can't work (because cookies are not defined), but this is problem with texts not with images (I don't tested them). |
Possible SolutionsMost of all, try rerunning the generate_content method without redeclaring the Gemini object.
If you've found a suitable solution to this issue, please share your experience on this issue page. Thank you. |
Hey, guys! Make sure you're using version Please test this script with the complete set of cookies collected manually: |
Using VPN or public IP, facing temporary blocks like 429 errors (due to repeated requests or authentication attempts) can disrupt the SSL/TLS handshake, resulting in an empty response. This issue isn't limited to specific accounts and might require IP-based circumvention. |
Still with the return message : {'metadata': ['c_c4d1c4aed0cb5eXX', 'r_3214ea893c673dXX'], 'prompt_class': None, 'prompt_candidates': [], 'candidates': [{'rcid': 'rc_5fbed4cbaf9e71XX', 'text': 'http://googleusercontent.com/card_content/0', 'code': {}, 'web_images': [], 'generated_images': []}]} |
Describe the bug
The response text is returned in a URL format that cannot be seen.
Version
OS: Windows 11
Python: 3.12.2
Gemini API: 1.0.4
Using proxy: No
Region: Poland
Code
Error
The text was updated successfully, but these errors were encountered: