1
- from typing import Optional
1
+ from typing import List , Optional , Union , Dict , Tuple
2
2
3
3
from bardapi .models .citation import DraftCitation
4
4
from bardapi .models .tools .code import CodeContent
@@ -22,7 +22,7 @@ def text(self) -> str:
22
22
return self ._input_list [1 ][0 ]
23
23
24
24
@property
25
- def citations (self ) -> list [DraftCitation ]:
25
+ def citations (self ) -> List [DraftCitation ]:
26
26
text = self .text
27
27
return (
28
28
[DraftCitation (c , text ) for c in self ._input_list [2 ][0 ]]
@@ -31,7 +31,7 @@ def citations(self) -> list[DraftCitation]:
31
31
)
32
32
33
33
@property
34
- def images (self ) -> list [BardImageContent ]:
34
+ def images (self ) -> List [BardImageContent ]:
35
35
# also in self._attachments[1]
36
36
return (
37
37
[BardImageContent (img ) for img in self ._input_list [4 ]]
@@ -49,7 +49,7 @@ def _attachments(self) -> Optional[list]:
49
49
return self ._input_list [12 ]
50
50
51
51
@property
52
- def map_content (self ) -> list [BardMapContent ]:
52
+ def map_content (self ) -> List [BardMapContent ]:
53
53
if not self ._attachments :
54
54
return []
55
55
return (
@@ -59,7 +59,7 @@ def map_content(self) -> list[BardMapContent]:
59
59
)
60
60
61
61
@property
62
- def gdocs (self ) -> list [BardGDocsContent ]:
62
+ def gdocs (self ) -> List [BardGDocsContent ]:
63
63
if not self ._attachments :
64
64
return []
65
65
return (
@@ -69,7 +69,7 @@ def gdocs(self) -> list[BardGDocsContent]:
69
69
)
70
70
71
71
@property
72
- def youtube (self ) -> list [BardYoutubeContent ]:
72
+ def youtube (self ) -> List [BardYoutubeContent ]:
73
73
if not self ._attachments :
74
74
return []
75
75
return (
@@ -79,7 +79,7 @@ def youtube(self) -> list[BardYoutubeContent]:
79
79
)
80
80
81
81
@property
82
- def python_code (self ) -> list [CodeContent ]:
82
+ def python_code (self ) -> List [CodeContent ]:
83
83
# Google has a dedicated Python model that can also run code.
84
84
# The text model uses the output of the Python model to generate answers,
85
85
# including answers in other languages.
@@ -94,15 +94,15 @@ def python_code(self) -> list[CodeContent]:
94
94
)
95
95
96
96
@property
97
- def links (self ) -> list [BardLink ]:
97
+ def links (self ) -> List [BardLink ]:
98
98
if not self ._attachments :
99
99
return []
100
100
return (
101
101
[BardLink (a ) for a in self ._attachments [8 ]] if self ._attachments [8 ] else []
102
102
)
103
103
104
104
@property
105
- def flights (self ) -> list [BardFlightContent ]:
105
+ def flights (self ) -> List [BardFlightContent ]:
106
106
if not self ._attachments :
107
107
return []
108
108
return (
@@ -112,7 +112,7 @@ def flights(self) -> list[BardFlightContent]:
112
112
)
113
113
114
114
@property
115
- def tool_disclaimers (self ) -> list [BardToolDeclaimer ]:
115
+ def tool_disclaimers (self ) -> List [BardToolDeclaimer ]:
116
116
if not self ._attachments or len (self ._attachments ) < 23 :
117
117
return []
118
118
@@ -123,7 +123,7 @@ def tool_disclaimers(self) -> list[BardToolDeclaimer]:
123
123
)
124
124
125
125
@property
126
- def user_content (self ) -> dict [str , UserContent ]:
126
+ def user_content (self ) -> Dict [str , UserContent ]:
127
127
d = {v .key : v for v in self .youtube }
128
128
d .update ({v .key : v for v in self .map_content })
129
129
d .update ({v .key : v for v in self .flights })
0 commit comments