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

Commit

Permalink
fix: formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
dsdanielpark committed Oct 2, 2023
1 parent c8caacb commit 43d796e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
20 changes: 10 additions & 10 deletions bardapi/models/draft.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import List, Optional, Union, Dict, Tuple
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 Down
6 changes: 3 additions & 3 deletions bardapi/models/result.py
Original file line number Diff line number Diff line change
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 List, Optional, Union, Dict, Tuple
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

0 comments on commit 43d796e

Please sign in to comment.