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

Commit

Permalink
build: 0.1.36 formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
dsdanielpark committed Oct 2, 2023
1 parent 135b10f commit 1714a73
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion bardapi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,5 @@
"max_sentence",
"Tool",
]
__version__ = "0.1.35"
__version__ = "0.1.36"
__author__ = "daniel park <parkminwoo1991@gmail.com>"
22 changes: 11 additions & 11 deletions bardapi/models/draft.py
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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]]
Expand All @@ -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]]
Expand All @@ -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 (
Expand All @@ -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 (
Expand All @@ -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 (
Expand All @@ -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.
Expand All @@ -94,15 +94,15 @@ def python_code(self) -> list[CodeContent]:
)

@property
def links(self) -> list[BardLink]:
def links(self) -> List[BardLink]:
if not self._attachments:
return []
return (
[BardLink(a) for a in self._attachments[8]] if self._attachments[8] else []
)

@property
def flights(self) -> list[BardFlightContent]:
def flights(self) -> List[BardFlightContent]:
if not self._attachments:
return []
return (
Expand All @@ -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 []

Expand All @@ -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})
Expand Down
8 changes: 4 additions & 4 deletions bardapi/models/result.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -35,15 +35,15 @@ 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
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 []
)
Expand All @@ -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 (
Expand Down
6 changes: 3 additions & 3 deletions bardapi/models/tools/youtube.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Optional
from typing import List, Optional, Union, Dict, Tuple

from bardapi.models.user_content import UserContent

Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
Expand Down

0 comments on commit 1714a73

Please sign in to comment.