Giter Club home page Giter Club logo

bard-api's Introduction

Development Status :: 4 - Beta

Google Bard API

PyPI package PyPI commit update Code style: black

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.


Please, Never expose the __Secure-1PSID for your safety. Never. Never.

Please 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

Install

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

Authentication

  1. Visit https://bard.google.com/
  2. F12 for console
  3. Session: Application → Cookies → Copy the value of __Secure-1PSID cookie.

Usage

Open In Colab

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


Scripts

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.

License

  • MIT
  • Belongs to Google AI's Bard license.
  • The code is licensed under the MIT License.
  • But retained under Google Bard's license policy in the future.
  • The author is not involved in legal responsibility, please refer to the bottom of the readme.
  • Just give me and them a star.

Bugs and Issues

Sincerely grateful for any reports on new features or bugs. Your valuable feedback on the code is highly appreciated.

Contacts

Reference

[1] https://github.com/acheong08/Bard

Important Warning: All legal responsibilities associated with the use of the package lie with the user.

The Python package BardAPI just provides code for Python developers to easily access Google Bard. All responsibility for handling data and using the package lies with the user. There is no monetary compensation received for the use of this code, and it should be noted that there is no liability for the use of the code. Please refer to the Google Bard Official Document for more details.

Could you kindly add this badge to your repository?

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.

bard-api's People

Contributors

dsdanielpark avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.