HanaokaYuzu / Gemini-API

✨ Elegant async Python API for Google Gemini web app
https://pypi.org/project/gemini-webapi/
GNU Affero General Public License v3.0
160 stars 20 forks source link

Image Generation Not Working. #3

Closed jollyolliel closed 7 months ago

jollyolliel commented 7 months ago

In the gemini webiste I can make it generate images of ex Dogs. When I use this API it gives me the error. When I ask it to send me images (From the web) it works and gives me the link. When I run it with the Generate command in the prompt. This is the error: 024-02-16 19:12:45.921 | SUCCESS | gemini.client:init:122 - Gemini client initiated successfully. Traceback (most recent call last): File "c:\Users\jolly\OneDrive\Documents\Programing\Reverse Enginer\Gemini\main.py", line 19, in <module> asyncio.run(main()) File "C:\Users\jolly\AppData\Local\Programs\Python\Python311\Lib\asyncio\runners.py", line 190, in run return runner.run(main) ^^^^^^^^^^^^^^^^ File "C:\Users\jolly\AppData\Local\Programs\Python\Python311\Lib\asyncio\runners.py", line 118, in run return self._loop.run_until_complete(task) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\jolly\AppData\Local\Programs\Python\Python311\Lib\asyncio\base_events.py", line 653, in run_until_complete return future.result() ^^^^^^^^^^^^^^^ File "c:\Users\jolly\OneDrive\Documents\Programing\Reverse Enginer\Gemini\main.py", line 13, in main response = await client.generate_content("generate me some pictures of dogs") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\jolly\AppData\Local\Programs\Python\Python311\Lib\site-packages\gemini\client.py", line 32, in wrapper return await func(self, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\jolly\AppData\Local\Programs\Python\Python311\Lib\site-packages\gemini\client.py", line 226, in generate_content and [ ^ File "C:\Users\jolly\AppData\Local\Programs\Python\Python311\Lib\site-packages\gemini\client.py", line 227, in <listcomp> GeneratedImage( File "C:\Users\jolly\AppData\Local\Programs\Python\Python311\Lib\site-packages\pydantic\main.py", line 171, in __init__ self.__pydantic_validator__.validate_python(data, self_instance=self) pydantic_core._pydantic_core.ValidationError: 1 validation error for GeneratedImage cookies Field required [type=missing, input_value={'url': 'https://lh3.goog... field of wildflowers.'}, input_type=dict] For further information visit https://errors.pydantic.dev/2.6/v/missing

HanaokaYuzu commented 7 months ago

Could you update package to v0.2.1 and try again?

jollyolliel commented 7 months ago

Amazing! Works