diff --git a/README.md b/README.md index 9512ef04a..ee1d21f5e 100644 --- a/README.md +++ b/README.md @@ -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)

diff --git a/bardapi/__init__.py b/bardapi/__init__.py index e9587962c..0a6382ffe 100644 --- a/bardapi/__init__.py +++ b/bardapi/__init__.py @@ -42,5 +42,5 @@ "max_token", "max_sentence", ] -__version__ = "0.1.30" +__version__ = "0.1.31" __author__ = "daniel park " diff --git a/bardapi/core.py b/bardapi/core.py index e392d84d7..b83736ead 100644 --- a/bardapi/core.py +++ b/bardapi/core.py @@ -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']) @@ -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: @@ -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") @@ -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'] @@ -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 @@ -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']) diff --git a/bardapi/core_async.py b/bardapi/core_async.py index 90e6ed39c..6041e2163 100644 --- a/bardapi/core_async.py +++ b/bardapi/core_async.py @@ -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 diff --git a/setup.py b/setup.py index 22831a4ab..33e17ba73 100644 --- a/setup.py +++ b/setup.py @@ -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.",