Skip to content
This repository has been archived by the owner on Apr 24, 2024. It is now read-only.

Commit

Permalink
build: update package files
Browse files Browse the repository at this point in the history
  • Loading branch information
dsdanielpark committed May 16, 2023
1 parent 5901d5b commit 452b0e7
Show file tree
Hide file tree
Showing 4 changed files with 95 additions and 20 deletions.
114 changes: 94 additions & 20 deletions bardapi.egg-info/PKG-INFO
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
Metadata-Version: 2.1
Name: bardapi
Version: 0.1.2
Summary: A package that returns Response of Google BARD through API.
Home-page: https://github.com/dsdanielpark/BARD_API
Version: 0.1.3
Summary: The python package that returns Response of Google Bard through API.
Home-page: https://github.com/dsdanielpark/Bard-API
Author: daniel park
Author-email: parkminwoo1991@gmail.com
Keywords: BARD,Python,Google Bard,Large Language Model,Chatbot API,Google API,Chatbot
Classifier: Development Status :: 3 - Alpha
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Science/Research
Classifier: Natural Language :: English
Classifier: Programming Language :: Python
Expand All @@ -18,29 +18,39 @@ Classifier: Programming Language :: Python :: 3.6
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.6
Description-Content-Type: text/markdown
License-File: LICENSE

Development Status :: 4 - Beta


# Google <a href="https://bard.google.com/"><img src="https://camo.githubusercontent.com/adb54264fe2ad5067d07d0752fc32600b4e6250073b01ce8c386575b431e3f06/68747470733a2f2f7777772e677374617469632e636f6d2f6c616d64612f696d616765732f66617669636f6e5f76315f31353031363063646466663766323934636533302e737667" height="20px"></a> BARD API
# Google <a href="https://bard.google.com/"><img src="https://camo.githubusercontent.com/adb54264fe2ad5067d07d0752fc32600b4e6250073b01ce8c386575b431e3f06/68747470733a2f2f7777772e677374617469632e636f6d2f6c616d64612f696d616765732f66617669636f6e5f76315f31353031363063646466663766323934636533302e737667" height="20px"></a> Bard API


<p align="left">
<a><img alt="PyPI package" src="https://img.shields.io/badge/pypi-BardAPI-blue"></a>
<a><img alt="PyPI package" src="https://img.shields.io/badge/pypi-BardAPI-black"></a>
<a href="https://pypi.org/project/bardapi/"><img alt="PyPI" src="https://img.shields.io/pypi/v/bardapi"></a>
<!-- <a href="https://pepy.tech/project/bardapi"><img alt="Downloads" src="https://pepy.tech/badge/bardapi"></a> -->
<a><img alt="commit update" src="https://img.shields.io/github/last-commit/dsdanielpark/Bard_API?color=blue"></a>
<!-- <a><img alt="commit update" src="https://img.shields.io/github/last-commit/dsdanielpark/Bard-API?color=black"></a> -->
<a href="https://github.com/psf/black"><img alt="Code style: black" src="https://img.shields.io/badge/code%20style-black-000000.svg"></a>
<a href="https://www.buymeacoffee.com/parkminwoo"><img src="https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png" height="20px"></a>
<a href="https://github.com/dsdanielpark/Bard-API"><img src="https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https%3A%2F%2Fgithub.com%2Fdsdanielpark%2FBARD_API&count_bg=%2379C83D&title_bg=%23555555&icon=&icon_color=%23E7E7E7&title=bardapi&edge_flat=false"/></a></a>
</p>


> A package that returns Response of Google BARD through API
> A package that returns Response of [Google Bard](https://bard.google.com/) through API

![](./assets/bardapi.gif)


I referred to the [GitHub repository](https://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](https://github.com/dsdanielpark/ExceptNotifier).
I referred to [this github repository(github.com/acheong08/Bard)](https://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](https://github.com/dsdanielpark/ExceptNotifier) and [Co-Coder](https://github.com/dsdanielpark/Co-Coder).

<br>

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.

<br>

## [Amazing Bard Prompts](https://github.com/dsdanielpark/amazing-bard-prompts) Is All You Need!
- Helpful prompts for Google Bard

<br>

Expand All @@ -51,26 +61,29 @@ pip install bardapi
```
You may instead want to use the development version from Github:
```
pip install git+https://github.com/dsdanielpark/BARD_API.git
pip install git+https://github.com/dsdanielpark/Bard-API.git
```

<br>

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

<br>

## Usage
## Usage
[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1YIMA8aBmEQSSk90bB0Q9tznaLLQcluGA?usp=share_link)


Simple Usage
```python
from bardapi import Bard
import os

os.environ['_BARD_API_KEY']="xxxxxxxx."
Bard().get_answer("What is Google BARD????")['content']
os.environ['_BARD_API_KEY']="xxxxxxxx"
Bard().get_answer("나와 내 동년배들이 좋아하는 뉴진스에 대해서 알려줘")['content']
```


Expand All @@ -80,19 +93,80 @@ import bardapi
import os

# set your __Secure-1PSID value to key
os.environ['_BARD_API_KEY']="xxxxxxxx."
os.environ['_BARD_API_KEY']="xxxxxxxx"

# set your input text
input_text = "What is Google Bard???"
input_text = "나와 내 동년배들이 좋아하는 뉴진스에 대해서 알려줘"

# Send an API request and get a response.
response = bardapi.core.Bard().get_answer(input_text)
```

Resolving errors due to delayed responses in Google Colab, containers, etc.
- If a response error occurs even though the normal procedure has been followed, use the timeout variable.
```python
from bardapi import Bard
import os
os.environ['_BARD_API_KEY']="xxxxxxxx"

bard = Bard(timeout=10) # Set timeout in seconds
bard.get_answer("나와 내 동년배들이 좋아하는 뉴진스에 대해서 알려줘")['content']
```


## Behind a proxy

```python
from bardapi import Bard
import os

os.environ['_BARD_API_KEY']="xxxxxxxx"
# Change 'http://127.0.0.1:1080' to your http proxy
# timeout in seconds
bard_inproxy = Bard(proxies={'http':'http://127.0.0.1:1080', 'https':'http://127.0.0.1:1080'}, timeout=10)
bard_inproxy.get_answer("나와 내 동년배들이 좋아하는 뉴진스에 대해서 알려줘")['content']
```

Example
<br>

<a href="https://bard.google.com/"><img src="./assets/bardimg.png" height="600px">

<br>


## Scripts
In the scripts [folder](./scripts/), I have released a script to help you compare [OpenAI-ChatGPT](./scripts/openai_api.ipynb) and [Google-Bard](./scripts/google_api.ipynb). I hope they will help more developers.

## License
Just Give me and [them](https://github.com/acheong08/Bard) a star.
- [MIT](https://opensource.org/license/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](https://github.com/acheong08/Bard) a star...

# Reference

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

## Contacts
- Core maintainer: [Daniel Park, South Korea](https://github.com/DSDanielPark) <br>
- E-mail: parkminwoo1991@gmail.com <br>

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

### Important Notice
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.


#### 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.


*Copyright (c) 2023 MinWoo Park, South Korea*<br>
1 change: 1 addition & 0 deletions bardapi.egg-info/SOURCES.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
LICENSE
README.md
setup.py
bardapi/__init__.py
Expand Down
Binary file added dist/bardapi-0.1.3-py3-none-any.whl
Binary file not shown.
Binary file added dist/bardapi-0.1.3.tar.gz
Binary file not shown.

0 comments on commit 452b0e7

Please sign in to comment.