GithubHelp home page GithubHelp logo

Comments (7)

ruanmus avatar ruanmus commented on May 14, 2024

Me too

from googlebard.

OliverwengFiltered avatar OliverwengFiltered commented on May 14, 2024

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.

OliverwengFiltered avatar OliverwengFiltered commented on May 14, 2024

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.

mehul-srivastava avatar mehul-srivastava commented on May 14, 2024

Hello @Ja-Sa-La! Could you please share your source code so that I can pinpoint the cause of this issue?

from googlebard.

Ja-Sa-La avatar Ja-Sa-La commented on May 14, 2024

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.

mehul-srivastava avatar mehul-srivastava commented on May 14, 2024

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.

Ja-Sa-La avatar Ja-Sa-La commented on May 14, 2024

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)

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.