Comments (12)
Is it correct that you have confirmed that responses are generated for short texts like "hi"?
For testing, try passing a generous timeout value to the Bard class.
Bard(timeout=200).get_answer("large Input text ")
from bard-api.
One thing I do know is that if I run this on another computer, the error goes away. Maybe it is restricted by IP address.
Recently, I confirmed that the cookie value is initialized even during use, and added it to the readme. Isn't the cookie value initialized during use?
It is unlikely that your IP is blocked. Because if the IP is blocked, you should not receive a proper response even on the web.
from bard-api.
The issue has been resolved, so I'm closing it. If you happen to identify the exact cause, I would appreciate it if you could share it. Thank you.
from bard-api.
Yes, And I think it has to do with the total amount sent from python so far, not the length.
I used to be able to communicate with bard normally, but suddenly they started sending back only Response Error.
I have the Timeout set to 512 and I get a ResponseError immediately.
from bard-api.
from bardapi import Bard
import os
import requests
import os
os.environ['_BARD_API_KEY']="MyToken"
session = requests.Session()
session.headers = {
"Host": "bard.google.com",
"X-Same-Domain": "1",
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Safari/537.36",
"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
"Origin": "https://bard.google.com",
"Referer": "https://bard.google.com/",
}
session.cookies.set("__Secure-1PSID", os.getenv("_BARD_API_KEY"))
# session.cookies.set("__Secure-1PSID", token)
bard = Bard(session=session, timeout=512)
# Continued conversation without set new session
bard.get_answer("hello")['content']
Bard(timeout=256).get_answer('hello')['content']
ResponseError occurred for both patterns.
from bard-api.
One thing I do know is that if I run this on another computer, the error goes away.
Maybe it is restricted by IP address.
from bard-api.
Only the computer was changed and the cookie values were executed identically. The Response Error still occurs there.
After about 10 hours from the time the Response Error was confirmed, I ran the program again from the same computer, and the conversation succeeded even with the same cookie.
Frequency may have something to do with it.
from bard-api.
Caution!
Please be aware that using this Python package carries certain risks and considerations. Here are some important points to keep in mind:
-
Not an Official Google Package: This package is not developed or maintained by Google. It is an unofficial implementation created to support developers in testing functionalities. As a result, it may not have the same level of reliability, support, or security as an official package.
-
No API Service: This package does not provide an API service. It should not be treated as a production-ready solution for commercial purposes. Its primary purpose is to assist with functional testing and experimentation.
-
Google Account Limitations: The package utilizes cookie values associated with a Google account. Excessive or abusive usage, particularly for commercial purposes, may lead to restrictions or limitations being imposed on your Google account. It is crucial to use this package responsibly and within the bounds of Google's terms of service.
-
Delayed Updates: Since this package is not officially supported by Google, it may experience delays in updates or compatibility with the latest Google services. Dependencies on Google services should be regularly monitored and updated to ensure proper functioning.
-
Readme Information: The cautionary details mentioned here have also been documented in the Readme file to ensure that users are well-informed about the nature and limitations of this package.
Please exercise caution and use this package responsibly.
from bard-api.
I think the token expires, i got this same error but i visited the bard website and saw a new token and used it.
from bard-api.
I think the token expires, i got this same error but i visited the bard website and saw a new token and used it.
I also saw that the token changes constantly. it would be interesting if we develop a way to update the token whenever it changes
from bard-api.
As the frequency of cookie changes has increased.
I merged some idea commit. #12
erickythierry
If you have any ideas for an automated method, I would greatly appreciate your contribution. Once you create a pull request, I will gladly test the functionality and merge it accordingly. However, please keep in mind that achieving global functionality may present certain challenges.
from bard-api.
The cookie is ok for 12 days, even when it changes via browser. Calling it too much and too frequently will result in a temporary ban
from bard-api.
Related Issues (20)
- ChatBard: token_from_browser HOT 9
- ImportError: cannot import name 'BardCookies' from partially initialized module 'bardapi' (most likely due to a circular import) HOT 6
- Some code errors in README examples , os module import HOT 4
- Bard __SECURE-1PSID does not match HOT 2
- Exception: SNlM0e value not found. Double-check __Secure-1PSID value or pass it as Bard(token='xxxxx') HOT 1
- Google changed the the way "__Secure-1PSID" looks, how to use this package effectively,the cookie values does not end in '.' period now HOT 8
- Multiple-Cookies has been changed. HOT 15
- Image generation HOT 4
- Google renames its chatbot Bard to Gemini HOT 40
- Gemini Ultra? HOT 4
- TooManyRedirects: Exceeded 30 redirects. HOT 1
- Check out this Bard/Gemini project. HOT 2
- Google changed their __Secure-1PSID value stracture HOT 2
- ask_about_image Not working HOT 2
- Cookies refreshing very often and getting 429 all the time HOT 2
- How can automaticly get cookies value in no gui servers? HOT 2
- Please, go to Gemini-API `https://github.com/dsdanielpark/Gemini-API`
- a conversation towards getting advance AI HOT 1
- Reflection on the Bard API Project
- Connecting Geminei to Ads HOT 1
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-api.