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

Commit

Permalink
Merge branch 'main' of https://github.com/CBoYXD/Bard-API
Browse files Browse the repository at this point in the history
  • Loading branch information
CBoYXD committed Aug 9, 2023
2 parents 8faa97d + 9b75f04 commit c1b15b3
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 24 deletions.
26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -223,19 +223,19 @@ Starting from version `0.1.18`, the GitHub version of BardAPI will be synchroniz
$ pip install git+https://github.com/dsdanielpark/Bard-API.git
```

- [Auto Cookie Bard](https://github.com/dsdanielpark/Bard-API/blob/main/README_DEV.md#auto-cookie-bard)
- [TTS from Bard](https://github.com/dsdanielpark/Bard-API/blob/main/README_DEV.md#text-to-speechtts)
- [Multi-language Bard API](https://github.com/dsdanielpark/Bard-API/blob/main/README_DEV.md#multi-language-bard-api)
- [Get image links](https://github.com/dsdanielpark/Bard-API/blob/main/README_DEV.md#get-image-links)
- [ChatBard](https://github.com/dsdanielpark/Bard-API/blob/main/README_DEV.md#chatbard)
- [Export Conversation](https://github.com/dsdanielpark/Bard-API/blob/main/README_DEV.md#export-conversation)
- [Export Code to Repl.it](https://github.com/dsdanielpark/Bard-API/blob/main/README_DEV.md#export-code-to-replit)
- [Executing Python code received as a response from Bard](https://github.com/dsdanielpark/Bard-API/blob/main/README_DEV.md#chatbard)
- [Using Bard Asynchronously](https://github.com/dsdanielpark/Bard-API/blob/main/README_DEV.md#using-bard-asynchronously)
- [Bard Cookies](https://github.com/dsdanielpark/Bard-API/blob/main/README_DEV.md#bard-which-can-get-cookies)
- [Fix Coversation ID (Fix Context)](https://github.com/dsdanielpark/Bard-API/blob/main/README_DEV.md#fix-conversation-id-fix-context)
- [max_token-max_sentence](https://github.com/dsdanielpark/Bard-API/blob/main/README_DEV.md#max_token-max_sentence)
- [Translation to another programming language](https://github.com/dsdanielpark/Bard-API/blob/main/README_DEV.md#translation-to-another-programming-language)
- [Auto Cookie Bard](https://github.com/dsdanielpark/Bard-API/blob/main/documents/README_DEV.md#auto-cookie-bard)
- [TTS from Bard](https://github.com/dsdanielpark/Bard-API/blob/main/documents/README_DEV.md#text-to-speechtts)
- [Multi-language Bard API](https://github.com/dsdanielpark/Bard-API/blob/main/documents/README_DEV.md#multi-language-bard-api)
- [Get image links](https://github.com/dsdanielpark/Bard-API/blob/main/documents/README_DEV.md#get-image-links)
- [ChatBard](https://github.com/dsdanielpark/Bard-API/blob/main/documents/README_DEV.md#chatbard)
- [Export Conversation](https://github.com/dsdanielpark/Bard-API/blob/main/documents/README_DEV.md#export-conversation)
- [Export Code to Repl.it](https://github.com/dsdanielpark/Bard-API/blob/main/documents/README_DEV.md#export-code-to-replit)
- [Executing Python code received as a response from Bard](https://github.com/dsdanielpark/Bard-API/blob/main/documents/README_DEV.md#chatbard)
- [Using Bard Asynchronously](https://github.com/dsdanielpark/Bard-API/blob/main/documents/README_DEV.md#using-bard-asynchronously)
- [Bard Cookies](https://github.com/dsdanielpark/Bard-API/blob/main/documents/README_DEV.md#bard-which-can-get-cookies)
- [Fix Coversation ID (Fix Context)](https://github.com/dsdanielpark/Bard-API/blob/main/documents/README_DEV.md#fix-conversation-id-fix-context)
- [max_token-max_sentence](https://github.com/dsdanielpark/Bard-API/blob/main/documents/README_DEV.md#max_token-max_sentence)
- [Translation to another programming language](https://github.com/dsdanielpark/Bard-API/blob/main/documents/README_DEV.md#translation-to-another-programming-language)

<br>
<br>
Expand Down
2 changes: 1 addition & 1 deletion bardapi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,5 @@
"max_token",
"max_sentence",
]
__version__ = "0.1.30"
__version__ = "0.1.31"
__author__ = "daniel park <parkminwoo1991@gmail.com>"
13 changes: 6 additions & 7 deletions bardapi/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def get_answer(self, input_text: str) -> dict:
Get an answer from the Bard API for the given input text.
Example:
>>> token = 'xxxxxxxxxx'
>>> token = 'xxxxxx'
>>> bard = Bard(token=token)
>>> response = bard.get_answer("나와 내 동년배들이 좋아하는 뉴진스에 대해서 알려줘")
>>> print(response['content'])
Expand Down Expand Up @@ -239,7 +239,7 @@ def speech(self, input_text: str, lang="en-US") -> dict:
Get speech audio from Bard API for the given input text.
Example:
>>> token = 'xxxxxxxxxx'
>>> token = 'xxxxxx'
>>> bard = Bard(token=token)
>>> audio = bard.speech("hello!")
>>> with open("bard.ogg", "wb") as f:
Expand Down Expand Up @@ -295,7 +295,7 @@ def export_conversation(self, bard_answer, title: str = ""):
Get Share URL for specific answer from bard
Example:
>>> token = 'xxxxxxxxxx'
>>> token = 'xxxxxx'
>>> bard = Bard(token=token)
>>> bard_answer = bard.get_answer("hello!")
>>> url = bard.export_conversation(bard_answer, title="Export Conversation")
Expand Down Expand Up @@ -364,7 +364,7 @@ def ask_about_image(self, input_text: str, image: bytes, lang: str = None) -> di
Send Bard image along with question and get answer
Example:
>>> token = 'xxxxxxxxxx'
>>> token = 'xxxxxx'
>>> bard = Bard(token=token)
>>> image = open('image.jpg', 'rb').read()
>>> bard_answer = bard.ask_about_image("what is in the image?", image)['content']
Expand Down Expand Up @@ -499,8 +499,7 @@ def ask_about_image(self, input_text: str, image: bytes, lang: str = None) -> di
content, target_language=us_lang
)
except Exception as e:
# TODO Log exception instead of print
print(e)
print(f"Translation failed, and the original text has been returned. \n{e}")
translated_content = content

# Returned dictionary object
Expand Down Expand Up @@ -530,7 +529,7 @@ def export_replit(
Get Export URL to repl.it from code
Example:
>>> token = 'xxxxxxxxxx'
>>> token = 'xxxxxx'
>>> bard = Bard(token=token)
>>> bard_answer = bard.get_answer("code python to print hello world")
>>> url = bard.export_replit(bard_answer['code'], bard_answer['langCode'])
Expand Down
3 changes: 1 addition & 2 deletions bardapi/core_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -654,8 +654,7 @@ async def ask_about_image(
content, target_language=us_lang
)
except Exception as e:
# TODO Log exception instead of print
print(e)
print(f"Translation failed, and the original text has been returned. \n{e}")
translated_content = content

# Returnd dictionary object
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def get_long_description():

setup(
name="bardapi",
version="0.1.30",
version="0.1.31",
author="daniel park",
author_email="parkminwoo1991@gmail.com",
description="The python package that returns Response of Google Bard through API.",
Expand Down

0 comments on commit c1b15b3

Please sign in to comment.