Giter Club home page Giter Club logo

Comments (12)

dsdanielpark avatar dsdanielpark commented on July 18, 2024 1

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.

dsdanielpark avatar dsdanielpark commented on July 18, 2024 1

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.

dsdanielpark avatar dsdanielpark commented on July 18, 2024 1

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.

yama-yeah avatar yama-yeah commented on July 18, 2024

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.

yama-yeah avatar yama-yeah commented on July 18, 2024
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.

yama-yeah avatar yama-yeah commented on July 18, 2024

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.

yama-yeah avatar yama-yeah commented on July 18, 2024

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.

dsdanielpark avatar dsdanielpark commented on July 18, 2024

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.

mrkeyiano avatar mrkeyiano commented on July 18, 2024

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.

erickythierry avatar erickythierry commented on July 18, 2024

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.

dsdanielpark avatar dsdanielpark commented on July 18, 2024

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.

javieranton-zz avatar javieranton-zz commented on July 18, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.