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.1.tar.gz
(4.9 kB
view details)
Built Distribution
File details
Details for the file GoogleBard-1.0.1.tar.gz
.
File metadata
- Download URL: GoogleBard-1.0.1.tar.gz
- Upload date:
- Size: 4.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d9d70c0f9a68339f95ee4225d827f3885694f2df89df01fdb7a84c2059e20b68 |
|
MD5 | e82226189bb8760c8dc3d0d1270105f7 |
|
BLAKE2b-256 | 194129fb6e4953a5e9ba8490a6772240981acaeccfe0d49495c614cb3e4679ad |
Provenance
File details
Details for the file GoogleBard-1.0.1-py3-none-any.whl
.
File metadata
- Download URL: GoogleBard-1.0.1-py3-none-any.whl
- Upload date:
- Size: 5.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 863bf07ff9372269d9f05489c213f65684f0c814c3c4c0a5ffe1427c95f0f3e1 |
|
MD5 | 6067280bbeb60bef02deeb93ad0083c8 |
|
BLAKE2b-256 | a78ed7ae302e189ee2b25609365efa71fff2e65a0da4aa75012f163f5e6d98c1 |