#๐ Error with bard
30 messages ยท Page 1 of 1 (latest)
@buoyant lance
Remember to:
- Ask your Python question, not if you can ask or if there's an expert who can help.
- Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
- Explain what you expect to happen and what actually happens.
:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.
im getting this error:
{'content': 'Response Error: b')]}\'\n\n38\n[["wrb.fr",null,null,null,null,[7]]]\n56\n[["di",50],["af.httprm",49,"-7539722186832686284",51]]\n25\n[["e",4,null,null,131]]\n'. \nUnable to get response.\nPlease double-check the cookie values and verify your network environment or google account.'}
here is my code:
import os
from bardapi import Bard
os.environ["_BARD_API_KEY"] = "BARD API KEY HERE"
print(Bard().get_answer("hello"))
Which version of bardapi is installed?
!pip bardapi
It might be inactive let me check
Yeah, they want you to use gemini api
click on that link there
It will redirect you
!pip gemini-api
alr
^
ty
You're welcome. If it doesn't work come back and open another thread.
@upper mural yo btw one question
that worked when i tried once but second time when i tried it gave me this error:
Traceback (most recent call last):
File "C:\Users\PC\Desktop\ChatBot\chatbot.py", line 8, in <module>
GeminiClient = Gemini(cookies=cookies)
^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\PC\AppData\Local\Programs\Python\Python311\Lib\site-packages\gemini\client.py", line 71, in init
self.session = session or self._initialize_session()
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\PC\AppData\Local\Programs\Python\Python311\Lib\site-packages\gemini\client.py", line 114, in _initialize_session
self._set_sid_and_nonce()
File "C:\Users\PC\AppData\Local\Programs\Python\Python311\Lib\site-packages\gemini\client.py", line 163, in _set_sid_and_nonce
raise e # Re-raise the exception after it's caught
^^^^^^^
File "C:\Users\PC\AppData\Local\Programs\Python\Python311\Lib\site-packages\gemini\client.py", line 156, in _set_sid_and_nonce
raise ValueError(
ValueError: Failed to parse SNlM0e nonce value from the response.
Refresh the Gemini web page or access Gemini in a new incognito browser to resend cookies.
If issue continues, export browser cookies, set manually. See auth section 3.
and the values for cookies are right
from gemini import Gemini
cookies = {
"cookie1": "cookie2",
"cookie2": "cookie3",
"cookie3": "cookie4"
}
GeminiClient = Gemini(cookies=cookies)
res = GeminiClient.send_request("Hello, Gemini. What's the weather like in Seoul today?")
print(res.text)
i did everything it asked in the error
but it didnt work
This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.
๐ Error with bard