environment
windows 10 64bit
Google Bard
python 3.8
Introduction
This article introduces the reverse engineering of an open source Google
chat robot. Using it, you can use the service for free. Project address: https://github.com/acheong08/BardBard
API
Bard
Installation and use
pip
Install via
pip <span class="hljs-keyword" style="color: rgb(248, 35, 117); word-wrap: inherit !important; word-break: inherit !important;" style="font-size: inherit;color: inherit;line-height: inherit;overflow-wrap: inherit !important;word-break: inherit !important;">install <span class="hljs-comment" style="color: rgb(128, 128, 128); word-wrap: inherit !important; word-break: inherit !important;" style="font-size: inherit;color: inherit;line-height: inherit;overflow-wrap: inherit !important;word-break: inherit !important;">--upgrade GoogleBard
</span class="hljs-comment" style="color: rgb(128, 128, 128); word-wrap: inherit !important; word-break: inherit !important;"></span class="hljs-keyword" style="color: rgb(248, 35, 117); word-wrap: inherit !important; word-break: inherit !important;">
Next, we need to get the session key, open the URL https://bard.google.com/ in the browser, press on the keyboard, enter the F12
console, come to Application
--> Cookies
, find url
, filter the string Secure-1PSID
, copy the value
Then, go to the terminal and start the service
<span class="hljs-attribute" style="color: rgb(238, 220, 112); word-wrap: inherit !important; word-break: inherit !important;" style="font-size: inherit;color: inherit;line-height: inherit;overflow-wrap: inherit !important;word-break: inherit !important;">python -m Bard --session <span class="hljs-string" style="color: rgb(238, 220, 112); word-wrap: inherit !important; word-break: inherit !important;" style="font-size: inherit;color: inherit;line-height: inherit;overflow-wrap: inherit !important;word-break: inherit !important;">"VgiTpJBqhJqxfinFutFiBhZq4CAJcEBFSnApxX_iSmQgxq7CJOr_zA68P4CsWjbZswnP9g."
</span class="hljs-string" style="color: rgb(238, 220, 112); word-wrap: inherit !important; word-break: inherit !important;"></span class="hljs-attribute" style="color: rgb(238, 220, 112); word-wrap: inherit !important; word-break: inherit !important;">
--session
The value of the parameter is the secret key copied above
You:
After the prompt, you can fill in the question you want to ask, then press Alt + Enter
or Esc + Enter
to send , and then wait Bard
for the answer. What is more embarrassing is that Bard
Chinese is not supported yet, but the response speed is still acceptable.
colab notebook
If you are used to it colab notebook
, you can visit this link
https://drive.google.com/file/d/1YyMWxTJgH4M0RbNRTpeDB8I97AZjKuc1/view?usp=sharing
FAQ
If the following error is reported when starting the service
Generally, it is because the above session key is incorrect. In some cases, the last one .
is also part of the key. For details, please refer to link 2 at the end of the article.
References
https://github.com/acheong08/Bard
https://github.com/acheong08/Bard/issues/11