Closed johnd0e closed 5 months ago
Thank you. I'm aware of this issue and others, needing to isolate errors and refactor, but detailed revisions are currently delayed due to the hiring process and other projects.
The most likely successful approach in your current situation is method 2, try rerunning the generate_content
method without redeclaring the Gemini
object. The first object of generate_content
might be empty.
AttributeError: 'NoneType' object has no attribute 'group'
v2.3.0
will support clear error message. GeminiClient = Gemini(cookies=cookies) # where cookies are __Secure-1PSID
, __Secure-1PSIDTS
generate_content
method without redeclaring the Gemini
object.Auto cookies
I will try to make time to address this issue as soon as possible.
Also, I have marked # To-Do
note in the source code to seek other contributors.
We are waiting for many contributors. Additionally, I do not expect frequent updates or added features for the Gemini API, as there is an official Gemini API, unlike with Bard API.
pipi install python-gemini-api==2.4.2
pip install -q -U python-gemini-api
I've updated it to version 2.4.2
. For cookies, users can now input them appropriately in dictionary format or contribute by creating them under misc.
@dsdanielpark
Both auto_cookie
and cookies
failed: ValueError: Failed to parse SNlM0e nonce value from the response
If I make fresh login in incognito mode, then it does not fail, but response is not useful - #14
Please make sure you're using version 2.4.2
or later and manually pass the complete cookie (avoid using auto_cookie).
Please test this script with the complete set of cookies collected manually: https://github.com/dsdanielpark/Gemini-API/blob/main/scripts/sample.ipynb
Most of error fixed. If error persists, please reopen issue.
Sorry, still does not work, neither with auto_cookies
, nor with manually set cookies.
And I have no problem using exactly same cookies set with another project - https://github.com/HanaokaYuzu/Gemini-API
GeminiClient = Gemini(cookie_fp="cookies.json")
For this case instructions recommends ExportThisCookies, but does not mentioned that downloaded with itcookies.txt
is not real json: it is necessary to trimcookies =
to make it valid json. But even with this I have no success:GeminiClient = Gemini(cookies=cookies)
(where cookies are__Secure-1PSID
,__Secure-1PSIDTS
) I get an output, but it is not very helpful:GeminiClient = Gemini(auto_cookies=True)
does not work:Originally posted by @johnd0e in https://github.com/dsdanielpark/Gemini-API/issues/2#issuecomment-1981722593
The issue is still relevant for v2.2.0