Reverse engineering of Google's Bard chatbot
Project description
Bard
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
. Copy the value of that 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
--session SESSION __Secure-1PSID cookie.
Quick mode
$ export BARD_QUICK="true"
$ export BARD_SESSION="<__Secure-1PSID>"
$ 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_SESSION=<REDACTED>.
python3 -m Bard "${@:-$(</dev/stdin)}" | tail -n+7
}
Developer Documentation
from os import environ
from Bard import Chatbot
token = environ.get("BARD_TOKEN")
chatbot = Chatbot(token)
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-1.0.2.tar.gz
(4.9 kB
view hashes)
Built Distribution
Close
Hashes for GoogleBard-1.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | eee7033f4ffa68fb2212928a5e11ba07e92471003409547efabd5e031dcb9cba |
|
MD5 | 10c599cec5230a8a460ae706a353c916 |
|
BLAKE2b-256 | 8d3a8c9ee27c18fd2071f7092c1531d8a3f268941cd3beb3391e484b36ad8c72 |