Development Status :: 4 - Beta
A package that returns Response of Google Bard through API
I referred to this github repository(github.com/acheong08/Bard) where inference process of Bard was reverse engineered. Using __Secure-1PSID
, you can ask questions and get answers from Google Bard. This package is designed for application to the Python package ExceptNotifier and Co-Coder.
Never expose the __Secure-1PSID
for your safety.
Note that while I referred to
__Secure-1PSID
value as an API KEY for convenience, it is not an officially provided API KEY.
Amazing Bard Prompts Is All You Need!
- Helpful prompts for Google Bard
The latest stable release (and required dependencies) can be installed from PyPI:
pip install bardapi
You may instead want to use the development version from Github:
pip install git+https://github.com/dsdanielpark/Bard-API.git
- Visit https://bard.google.com/
- F12 for console
- Session: Application → Cookies → Copy the value of
__Secure-1PSID
cookie.
Simple Usage
from bardapi import Bard
import os
os.environ['_BARD_API_KEY']="xxxxxxxx"
Bard().get_answer("나와 내 동년배들이 좋아하는 뉴진스에 대해서 알려줘")['content']
Or you can use this
import bardapi
import os
# set your __Secure-1PSID value to key
os.environ['_BARD_API_KEY']="xxxxxxxx"
# set your input text
input_text = "나와 내 동년배들이 좋아하는 뉴진스에 대해서 알려줘"
# Send an API request and get a response.
response = bardapi.core.Bard().get_answer(input_text)
Example
In the scripts folder, I have released a script to help you compare OpenAI-ChatGPT and Google-Bard. I hope they will help more developers.
- MIT
- I hold no legal responsibility; for more information, please refer to the bottom of the readme file. I just want you to give me and them a star...
Sincerely grateful for any reports on new features or bugs. Your valuable feedback on the code is highly appreciated.
- Core maintainer: Daniel Park, South Korea
- E-mail: parkminwoo1991@gmail.com
[1] https://github.com/acheong08/Bard
The user assumes all legal responsibilities associated with using the BardAPI package. This Python package merely facilitates easy access to Google Bard for developers. Users are solely responsible for managing data and using the package appropriately. For further information, please consult the Google Bard Official Document.
markdown
![BardAPI](https://img.shields.io/badge/pypi-BardAPI-black)
html
<a href="https://github.com/dsdanielpark/Bard-API"><img alt="PyPI package" src="https://img.shields.io/badge/pypi-BardAPI-black"></a>
Thank you for your interest.
Copyright (c) 2023 MinWoo Park, South Korea