This repository was archived by the owner on Aug 10, 2023. It is now read-only.
- Notifications
You must be signed in to change notification settings - Fork171
Python SDK/API for reverse engineered Google Bard
License
NotificationsYou must be signed in to change notification settings
acheong08/Bard
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Reverse engineering of Google's Bard chatbot API
$ pip3 install --upgrade GoogleBard
- F12 for console
- Copy the values
- Session: Go to Application → Cookies →
__Secure-1PSIDand__Secure-1PSIDTS. Copy the value of those cookie.
- Session: Go to Application → Cookies →
$ python3 -m Bard -husage: Bard.py [-h] --session<__Secure-1PSID> --session_ts<__Secure-1PSIDTS>options: -h, --help show thishelp message andexit --session --session_ts pass two cookies
$ export BARD_QUICK="true"$ export BARD__Secure_1PSID="<__Secure-1PSID>"$ export BARD__Secure_1PSIDTS="<__Secure-1PSIDTS>"$ python3 -m BardEnvironment variables can be placed in .zshrc.
Example bash shortcut:
# USAGE1: bard QUESTION# USAGE2: echo "QUESTION" | bardbard () {export BARD_QUICK=trueexport BARD__Secure_1PSID=<__Secure-1PSID>export BARD__Secure_1PSIDTS=<__Secure-1PSIDTS>python3 -m Bard"${@:-$(</dev/stdin)}"| tail -n+7}
fromosimportenvironfromBardimportChatbotSecure_1PSID=environ.get("BARD__Secure_1PSID")Secure_1PSIDTS=environ.get("BARD__Secure_1PSIDTS")chatbot=Chatbot(Secure_1PSID,Secure_1PSIDTS)answer=chatbot.ask("Hello, how are you?")print(answer['content']
importasynciofromosimportenvironfromBardimportAsyncChatbotSecure_1PSID=environ.get("BARD__Secure_1PSID")Secure_1PSIDTS=environ.get("BARD__Secure_1PSIDTS")asyncdefmain():chatbot=awaitAsyncChatbot.create(Secure_1PSID,Secure_1PSIDTS)response=awaitchatbot.ask("Hello, how are you?")print(response['content'])asyncio.run(main())
Credits:
- discordtehe - Derivative of his original reverse engineering
About
Python SDK/API for reverse engineered Google Bard
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
No packages published
Uh oh!
There was an error while loading.Please reload this page.
Contributors8
Uh oh!
There was an error while loading.Please reload this page.