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

Uploaded Source

Built Distribution

GoogleBard-1.1.0-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for GoogleBard-1.1.0.tar.gz
Algorithm Hash digest
SHA256 b90d7a97d38e6f67180b219b380ecf59f607b2e30fa611332e56000183778b6a
MD5 7c924ef8dc46465a3b0c0c33d688837b
BLAKE2b-256 bdd1ab9ab863882923e2fd47d78250607e17b520f914a5e070a28bbba73bc82f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: GoogleBard-1.1.0-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

Hashes for GoogleBard-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6fb2e221998fbc292051c3e3a358c5a3d4544f1bb702797d7da43b909aa32463
MD5 03dfb0b1b6efec3178501f550ed50866
BLAKE2b-256 7f5127bfd03ac31d26b7c618f49221e36d6b287bc9cfdf67e0534c9b17acc113

See more details on using hashes here.

Supported by

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