Skip to main content

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.

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


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.2.1.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

GoogleBard-1.2.1-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

Details for the file GoogleBard-1.2.1.tar.gz.

File metadata

  • Download URL: GoogleBard-1.2.1.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for GoogleBard-1.2.1.tar.gz
Algorithm Hash digest
SHA256 f8addd0f46b2b30f71d0d29a44aa19eac5c4eac508eeeb416d4edd8898e9bce8
MD5 bbbb0a883f34eea09cc8b74d8a4ba514
BLAKE2b-256 470486d39db3391ac0b53e498b1c3e08b03dce1b2298f17f9df58e15cdcef6c6

See more details on using hashes here.

Provenance

File details

Details for the file GoogleBard-1.2.1-py3-none-any.whl.

File metadata

  • Download URL: GoogleBard-1.2.1-py3-none-any.whl
  • Upload date:
  • Size: 5.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for GoogleBard-1.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 887295fcade202c73aa58841f00e8718ec0e863a6a7dbb9a02eded215f849e20
MD5 45eaa1c65ef1d18d8212647bf41d85ee
BLAKE2b-256 ae0d8e3c68e21dda3543669358709af28d90271b27bdf56b62699ec6d2754176

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page