Comments (14)
Attempts to solve:
- Ensure you are only signed in to 1 account.
- Ensure your IP address is in the US (or other supported regions)
from bard.
I'm seeing the same error. My IP address is in the US, and I'm only signed in to one account.
from bard.
For everyone's convenience (as an easy meanwhile solution while this is being resolved), you can obtain the SNlM0e
directly from your Bard browser session. I mean if you were already going to open the dev tools in that window to get the cookie from 'Applications' tab, might as well just use console.log(WIZ_global_data.SNlM0e);
in the console window to get the SNlM0e value, then you could copy and paste both in one trip to the browser window.
from bard.
How do you get the module to use the value that you've extracted?
from bard.
How do you get the module to use the value that you've extracted?
Similar to how you pass the cookie string value to the Bard.py script
bard () {
export BARD_QUICK=true
export BARD_SESSION=<REDACTED>.
python3 -m Bard "${@:-$(</dev/stdin)}" | tail -n+7
}
you could do the same for SNlM0e:
export BARD_SNlM0e=<REDACTED>.
Then you could modify your __get_snlm0e(self): function to just call it from os env and avoid the whole api request:
def __get_snlm0e(self):
SNlM0e= os.getenv("BARD_SNlM0e")
return SNlM0e
I do something similar using NodeJS in my project DuelGPT (a front-end for using ChatGPT and Bard side-by-side - minimal backend code)
from bard.
Exporting SNlM0e from console gives me a different error:
Google Bard encountered an error:
b')]}'\n\n38\n[["wrb.fr",null,null,null,null,[7]]]\n56\n[["di",52],["af.httprm",51,"-8317639822438177330",23]]\n25\n[["e",4,null,null,131]]\n'.
from bard.
Exporting SNlM0e from console gives me a different error:
Google Bard encountered an error: b')]}'\n\n38\n[["wrb.fr",null,null,null,null,[7]]]\n56\n[["di",52],["af.httprm",51,"-8317639822438177330",23]]\n25\n[["e",4,null,null,131]]\n'.
Yep having this too…
from bard.
Works great when I call it from the command line, but when I try to use it in a script I keep getting the same error.
from Bard import Chatbot
token = "Current Cookie Value"
chatbot = Chatbot(token)
chatbot.ask("Hello, how are you?")
produces 'NoneType' object is not iterable. I'm sure I'm missing something obvious
from bard.
@karlzipple You can go to Bard.py to change the functionality of 'def ask(self, message: str) -> dict:', print out the 'json_chat_data' to see what is your task-oriented requirement, and customize the 'results' yourself to skip the Nonetype error. That could be a cheap solution.
from bard.
How do you get the module to use the value that you've extracted?
Similar to how you pass the cookie string value to the Bard.py script
bard () { export BARD_QUICK=true export BARD_SESSION=<REDACTED>. python3 -m Bard "${@:-$(</dev/stdin)}" | tail -n+7 }you could do the same for SNlM0e:
export BARD_SNlM0e=<REDACTED>.Then you could modify your __get_snlm0e(self): function to just call it from os env and avoid the whole api request:
def __get_snlm0e(self): SNlM0e= os.getenv("BARD_SNlM0e") return SNlM0eI do something similar using NodeJS in my project DuelGPT (a front-end for using ChatGPT and Bard side-by-side - minimal backend code)
can you please retype this. What the hell is . ? Does it contain < > ? Does it end with a period? <1687168999467>. ? is it <DFuTz6sfj1k3Bu814Vj8_3JhXhvE:1687168999467> ? is it DFuTz6sfj1k3Bu814Vj8_3JhXhvE:1687168999467? is it "DFuTz6sfj1k3Bu814Vj8_3JhXhvE:1687168999467" ? Please. Be specific.
from bard.
The latest release resolves this issue. You don't need to make any modifications to the code for this to work. Just pull main
.
Here's my working code, copied from the README.md in ~/.bash_profile
# USAGE1: bard QUESTION
# USAGE2: echo "QUESTION" | bard
bard () {
export BARD_QUICK=true
export BARD_SESSION="REDACTED"
python3 -m Bard "${@:-$(</dev/stdin)}" | tail -n+7
}
Here's an example of it working:
$ bard "What is the capital of Argentina?"
/usr/local/lib/python3.10/site-packages/Bard.py:62: DeprecationWarning: There is no current event loop
self.loop = asyncio.get_event_loop()
The capital of Argentina is Buenos Aires. It is the most populous city in Argentina, with a metropolitan area of over 15 million people.
Buenos Aires is located on the western shore of the Río de la Plata, on South America's southeastern coast. The city was founded in 1536
by Spanish colonists, and it became the capital of Argentina in 1880. Buenos Aires is a major economic, cultural, and political center in
South America. It is home to the Argentine National Congress, the Supreme Court of Argentina, and the Casa Rosada, the official residence
of the President of Argentina. Buenos Aires is also a major center for tourism, with a wide variety of attractions, including museums,
theaters, restaurants, and nightlife.
from bard.
i still cant get it to work :( Im using the chatbot usecase, with ChatGPT-DIscord-Bot-1.5.1. By commenting out the errors and pasting in the SNlM0e directly instead of using the __Secure_1*** cookie, because it gives me the "must end with a dot" error even though it DOES end with a dot, i finally get it to fully load the discord bot, but when i go to get a response it says
Google Bard encountered an error: b')]}'\n\n38\n[["wrb.fr",null,null,null,null,[7]]]\n56\n[["di",60],["af.httprm",60,"-8234551735768967562",38]]\n25\n[["e",4,null,null,131]]\n'.
I know its still related to the cookie.
I dont know how
bard () {
export BARD_QUICK=true
export BARD_SESSION="REDACTED"
python3 -m Bard "${@:-$(</dev/stdin)}" | tail -n+7
}
relates in any possible way
from bard.
async def __get_snlm0e(self):
# Find "SNlM0e":"<ID>"
#if not self.session_id or self.session_id[-1] != ".":
# raise Exception(
# "__Secure-1PSID value must end with a single dot. Enter correct __Secure-1PSID value.",
# )
resp = await self.session.get(
"https://bard.google.com/",
timeout=10,
follow_redirects=True,
)
if resp.status_code != 200:
raise Exception(
f"Response code not 200. Response Status is {resp.status_code}",
)
SNlM0e = re.search(r"SNlM0e\":\"(.*?)\"", "AFuTs6sfj1k3Bu814Vj8_3JhXhvE:1687168999468")
##if not SNlM0e:
# raise Exception(
# "SNlM0e value not found in response. Check __Secure-1PSID value.",
# )
return "(.1687168999468?)"
from bard.
Worked yesterday; Not working today. I wonder why it happen, but getting site with cURL (with and without cookie) doesn't include SNlM0e too.
from bard.
Related Issues (20)
- use await with AsyncChatbot.ask
- 'NoneType' object is not subscriptable HOT 2
- 'AsyncChatbot' object has no attribute 'SNlM0e' HOT 1
- API call is failing. Google may have changed the API response structure HOT 7
- API failing to get response HOT 1
- RuntimeError: There is no current event loop in thread HOT 3
- IndexError: list index out of range HOT 1
- always response 429 HOT 2
- I code this,but can't running.how to correct this?
- How to use the new Google Lens feature in this API? HOT 3
- always show IndexError: list index out of range HOT 1
- Exception has occurred: Exception SNlM0e value not found in response. Check __Secure-1PSID value. HOT 7
- [Feature Idea] Is it possible to refresh the "1PSIDTS" HOT 1
- conversation_id 这个如何提交?如何长对话 HOT 1
- Secure_1PSIDTS value refreshing at very high rate. HOT 4
- Stopped working HOT 4
- Error with the example python code from the readme HOT 1
- KeyError: 'images'
- Works fine locally but does not while hosted to Huggingface spaces .
- Module bardapi not recognised anymore HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bard.