diff --git a/bardapi.egg-info/PKG-INFO b/bardapi.egg-info/PKG-INFO index 750503d86..da10cd16d 100644 --- a/bardapi.egg-info/PKG-INFO +++ b/bardapi.egg-info/PKG-INFO @@ -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 @@ -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 BARD API +# Google Bard API

-PyPI package +PyPI package PyPI -commit update + Code style: black - +

- -> 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). + +
+ +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](https://github.com/dsdanielpark/amazing-bard-prompts) Is All You Need! +- Helpful prompts for Google Bard
@@ -51,7 +61,7 @@ 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 ```
@@ -59,18 +69,21 @@ 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. +3. Session: Application → Cookies → Copy the value of `__Secure-1PSID` cookie.
-## 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'] ``` @@ -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
+ + +
+ + +## 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)
+- E-mail: parkminwoo1991@gmail.com
+ +## 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 +``` +
PyPI package +``` +Thank you for your interest. + + +*Copyright (c) 2023 MinWoo Park, South Korea*
diff --git a/bardapi.egg-info/SOURCES.txt b/bardapi.egg-info/SOURCES.txt index 7a9db4d80..caacff6fa 100644 --- a/bardapi.egg-info/SOURCES.txt +++ b/bardapi.egg-info/SOURCES.txt @@ -1,3 +1,4 @@ +LICENSE README.md setup.py bardapi/__init__.py diff --git a/dist/bardapi-0.1.3-py3-none-any.whl b/dist/bardapi-0.1.3-py3-none-any.whl new file mode 100644 index 000000000..3215d5c9e Binary files /dev/null and b/dist/bardapi-0.1.3-py3-none-any.whl differ diff --git a/dist/bardapi-0.1.3.tar.gz b/dist/bardapi-0.1.3.tar.gz new file mode 100644 index 000000000..40e1a19e1 Binary files /dev/null and b/dist/bardapi-0.1.3.tar.gz differ