Comments (7)
Me too
from googlebard.
yea, I have the same issue,
it works with my local machine.
but once the code pushed to cloud server, it throws this error.
is it because the server is behind the reverse proxy ?
from googlebard.
this is the error message I'm getting
Error parsing response: make sure you are using the correct cookie, copy the value of "__Secure-1PSID" cookie and set it like this:
new Bard("__Secure-1PSID=<COOKIE_VALUE>")
Also using a US proxy is recommended.
If this error persists, please open an issue on github.
https://github.com/PawanOsman/GoogleBard
I'm pretty sure, my server is deployed under US-central-1 region and the cookie value is presented in the code. and it works on the local machine.
from googlebard.
Hello @Ja-Sa-La! Could you please share your source code so that I can pinpoint the cause of this issue?
from googlebard.
Hey @mehul-srivastava, relevant parts to the code are here:
import {Bard} from "googlebard"; let cookies = "__Secure-1PSID=cookie here"; let bot = new Bard(cookies);
export async function GoogleWithoutModifiers(textToSend) { return new Promise(async (resolve, reject) => { console.log("GoogleWithoutModifiers"); let conversationId = makeid(10); let response = {text: String, convoid: String}; response.text = await bot.ask(textToSend, conversationId); query("INSERT INTO AI (engine, Data) VALUES (?,?)", ["Google", conversationId], await function (err, results, fields) { response.convoid = results.insertId; return resolve(response); }) })}
function makeid(length) { let result = ''; const characters = '0123456789'; const charactersLength = characters.length; let counter = 0; while (counter < length) { result += characters.charAt(Math.floor(Math.random() * charactersLength)); counter += 1; } return result; }
Edit:
It would seem like it's only an issue when the bot is running on my VPS. Both I and the server are using the same open VPN server to send the requests, so I am not exactly sure what the issue could be.
from googlebard.
This exact piece of code works perfectly for me. I still think there might be an issue with the cookie. This may happen if you are using some other google account to interact with bard.google.com but using the cookie as __Secure-1PSID=
.
I have written about it here - https://github.com/PawanOsman/GoogleBard#prerequisite---how-to-get-cookies. (how different account corresponds to a different cookie like __Secure-3PSID=
)
If you followed the documentation well but still receiving an error, maybe try clearing cookies from your browser once and copy the new cookie from the official website.
If you still face an issue, there is something else that needs to be looked into.
from googlebard.
yeah, i was able to confirm it as working as well. on my local machine. though still on the VPS it fails to get any info using the same IP. Bing/chatgpt queries are working fine with chatgpt-api & bing-chat & Imagen via api.pawan.krd. vps is running almalinux 8
from googlebard.
Related Issues (20)
- how to change language HOT 1
- The proxy does not work HOT 3
- Cookie Validity HOT 2
- Confirmation of validity
- API gives unexpected/bad responses HOT 2
- Google Bard's Reverse Engineering Ineffectiveness after Update
- Google Bard encountered an error HOT 1
- Request fails without the __Secure-1PSIDTS cookie HOT 8
- Empty response when the query includes a url
- Traceback HOT 1
- Sometimes response country code. HOT 3
- How to get the cookie HOT 2
- Add the ability to send message for Bard
- how to use in commonJS HOT 1
- __Secure-1PSIDTS is also needed HOT 3
- My account number is 0 HOT 2
- Error in Response
- ERR_REQUIRE_ESM HOT 1
- SWML_DESCRIPTION_FROM_YOUR_INTERNET_ADDRESS 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 googlebard.