Reverse engineering of Google's Bard chatbot
Project description
Bard ![](https://pypi-camo.freetls.fastly.net/e65efc4e1779ba403d7cef3b9090065905dd606e/68747470733a2f2f7777772e677374617469632e636f6d2f6c616d64612f696d616765732f66617669636f6e5f76315f31353031363063646466663766323934636533302e737667)
Reverse engineering of Google's Bard chatbot API
Installation
$ pip3 install --upgrade GoogleBard
Authentication
Go to https://bard.google.com/
- F12 for console
- Copy the values
- Session: Go to Application → Cookies →
__Secure-1PSID
and__Secure-1PSIDTS
. Copy the value of those cookie.
- Session: Go to Application → Cookies →
Usage
$ python3 -m Bard -h
usage: Bard.py [-h] --session SESSION
options:
-h, --help show this help message and exit
--__Secure_1PSID --__Secure_1PSIDTS pass two cookies
Quick mode
$ export BARD_QUICK="true"
$ export BARD___Secure-1PSID="<__Secure-1PSID>"
$ export BARD___Secure-1PSIDTS="<__Secure-1PSIDTS>"
$ python3 -m Bard
Environment variables can be placed in .zshrc.
Example bash shortcut:
# USAGE1: bard QUESTION
# USAGE2: echo "QUESTION" | bard
bard () {
export BARD_QUICK=true
export BARD___Secure-1PSID==<REDACTED>.
export BARD___Secure-1PSIDTS==<REDACTED>.
python3 -m Bard "${@:-$(</dev/stdin)}" | tail -n+7
}
Developer Documentation
from os import environ
from Bard import Chatbot
Secure_1PSID = environ.get("BARD__Secure-1PSID")
Secure_1PSIDTS = environ.get("BARD__Secure-1PSIDTS")
chatbot = Chatbot(Secure_1PSID, Secure_1PSIDTS)
chatbot.ask("Hello, how are you?")
Credits:
- discordtehe - Derivative of his original reverse engineering
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
GoogleBard-2.0.0.tar.gz
(6.1 kB
view hashes)
Built Distribution
Close
Hashes for GoogleBard-2.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 97e7b8298ef98e4cab1a1d185d78df6bba5770b25d41a209666b2917bdc4b989 |
|
MD5 | 283f5439b0c59afe527f6e87fc16d149 |
|
BLAKE2b-256 | 240385837c55e9b9858ed004d7b06222e0d21a3258c9eb9590f1c28743f9fe4e |