From 1714a73c2acfe515d1411e27b78a6fbc9d126719 Mon Sep 17 00:00:00 2001 From: parkminwoo Date: Mon, 2 Oct 2023 21:24:48 +0900 Subject: [PATCH] build: 0.1.36 formatting --- bardapi/__init__.py | 2 +- bardapi/models/draft.py | 22 +++++++++++----------- bardapi/models/result.py | 8 ++++---- bardapi/models/tools/youtube.py | 6 +++--- setup.py | 2 +- 5 files changed, 20 insertions(+), 20 deletions(-) diff --git a/bardapi/__init__.py b/bardapi/__init__.py index e90a98d46..b4dc7242d 100644 --- a/bardapi/__init__.py +++ b/bardapi/__init__.py @@ -44,5 +44,5 @@ "max_sentence", "Tool", ] -__version__ = "0.1.35" +__version__ = "0.1.36" __author__ = "daniel park " diff --git a/bardapi/models/draft.py b/bardapi/models/draft.py index 936d4528a..48aa284cf 100644 --- a/bardapi/models/draft.py +++ b/bardapi/models/draft.py @@ -1,4 +1,4 @@ -from typing import Optional +from typing import List, Optional, Union, Dict, Tuple from bardapi.models.citation import DraftCitation from bardapi.models.tools.code import CodeContent @@ -22,7 +22,7 @@ def text(self) -> str: return self._input_list[1][0] @property - def citations(self) -> list[DraftCitation]: + def citations(self) -> List[DraftCitation]: text = self.text return ( [DraftCitation(c, text) for c in self._input_list[2][0]] @@ -31,7 +31,7 @@ def citations(self) -> list[DraftCitation]: ) @property - def images(self) -> list[BardImageContent]: + def images(self) -> List[BardImageContent]: # also in self._attachments[1] return ( [BardImageContent(img) for img in self._input_list[4]] @@ -49,7 +49,7 @@ def _attachments(self) -> Optional[list]: return self._input_list[12] @property - def map_content(self) -> list[BardMapContent]: + def map_content(self) -> List[BardMapContent]: if not self._attachments: return [] return ( @@ -59,7 +59,7 @@ def map_content(self) -> list[BardMapContent]: ) @property - def gdocs(self) -> list[BardGDocsContent]: + def gdocs(self) -> List[BardGDocsContent]: if not self._attachments: return [] return ( @@ -69,7 +69,7 @@ def gdocs(self) -> list[BardGDocsContent]: ) @property - def youtube(self) -> list[BardYoutubeContent]: + def youtube(self) -> List[BardYoutubeContent]: if not self._attachments: return [] return ( @@ -79,7 +79,7 @@ def youtube(self) -> list[BardYoutubeContent]: ) @property - def python_code(self) -> list[CodeContent]: + def python_code(self) -> List[CodeContent]: # Google has a dedicated Python model that can also run code. # The text model uses the output of the Python model to generate answers, # including answers in other languages. @@ -94,7 +94,7 @@ def python_code(self) -> list[CodeContent]: ) @property - def links(self) -> list[BardLink]: + def links(self) -> List[BardLink]: if not self._attachments: return [] return ( @@ -102,7 +102,7 @@ def links(self) -> list[BardLink]: ) @property - def flights(self) -> list[BardFlightContent]: + def flights(self) -> List[BardFlightContent]: if not self._attachments: return [] return ( @@ -112,7 +112,7 @@ def flights(self) -> list[BardFlightContent]: ) @property - def tool_disclaimers(self) -> list[BardToolDeclaimer]: + def tool_disclaimers(self) -> List[BardToolDeclaimer]: if not self._attachments or len(self._attachments) < 23: return [] @@ -123,7 +123,7 @@ def tool_disclaimers(self) -> list[BardToolDeclaimer]: ) @property - def user_content(self) -> dict[str, UserContent]: + def user_content(self) -> Dict[str, UserContent]: d = {v.key: v for v in self.youtube} d.update({v.key: v for v in self.map_content}) d.update({v.key: v for v in self.flights}) diff --git a/bardapi/models/result.py b/bardapi/models/result.py index b5e543ee5..3f403fcc2 100644 --- a/bardapi/models/result.py +++ b/bardapi/models/result.py @@ -1,4 +1,4 @@ -from typing import Optional +from typing import List, Optional, Union, Dict, Tuple from bardapi.models.draft import BardDraft from bardapi.models.tools.tool import BardTool @@ -35,7 +35,7 @@ def __init__(self, input_list: list): self.response_id = self._input_list[1][1] @property - def search_queries(self) -> list[str, int]: + def search_queries(self) -> List[str, int]: return self._input_list[2] @property @@ -43,7 +43,7 @@ def factuality_queries(self) -> Optional[list]: return self._input_list[3] @property - def drafts(self) -> list[BardDraft]: + def drafts(self) -> List[BardDraft]: return ( [BardDraft(c) for c in self._input_list[4]] if self._input_list[4] else [] ) @@ -67,7 +67,7 @@ def topic(self) -> Optional[str]: return self._input_list[10][0] @property - def tools_applied(self) -> list[BardTool]: + def tools_applied(self) -> List[BardTool]: if len(self._input_list) < 12: return [] return ( diff --git a/bardapi/models/tools/youtube.py b/bardapi/models/tools/youtube.py index a4f8a993b..26474b169 100644 --- a/bardapi/models/tools/youtube.py +++ b/bardapi/models/tools/youtube.py @@ -1,4 +1,4 @@ -from typing import Optional +from typing import List, Optional, Union, Dict, Tuple from bardapi.models.user_content import UserContent @@ -28,7 +28,7 @@ def channel_logo(self) -> str: return self._input_list[4] @property - def text(self) -> Optional[list[str]]: + def text(self) -> Optional[List[str]]: return self._input_list[5] def __str__(self) -> str: @@ -60,7 +60,7 @@ def __len__(self): return len(self._input_list[4][0]) @property - def videos(self) -> list[BardYoutubeVideo]: + def videos(self) -> List[BardYoutubeVideo]: return ( [BardYoutubeVideo(video) for video in self._input_list[4][0]] if self._input_list[4] diff --git a/setup.py b/setup.py index 4dcdee1bf..ad2550174 100644 --- a/setup.py +++ b/setup.py @@ -25,7 +25,7 @@ def get_long_description(): setup( name="bardapi", - version="0.1.35", + version="0.1.36", author="daniel park", author_email="parkminwoo1991@gmail.com", description="The python package that returns Response of Google Bard through API.",