Skip to content

Commit bdd4eb6

Browse files
hkt74copybara-github
authored andcommitted
chore: update comment
PiperOrigin-RevId: 879203048
1 parent 9a4fd39 commit bdd4eb6

35 files changed

Lines changed: 145 additions & 154 deletions

google/genai/_interactions/types/code_execution_call_content.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,6 @@ class CodeExecutionCallContent(BaseModel):
3030
"""A unique ID for this specific tool call."""
3131

3232
arguments: CodeExecutionCallArguments
33-
"""The arguments to pass to the code execution."""
33+
"""Required. The arguments to pass to the code execution."""
3434

3535
type: Literal["code_execution_call"]

google/genai/_interactions/types/code_execution_call_content_param.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,6 @@ class CodeExecutionCallContentParam(TypedDict, total=False):
3131
"""A unique ID for this specific tool call."""
3232

3333
arguments: Required[CodeExecutionCallArgumentsParam]
34-
"""The arguments to pass to the code execution."""
34+
"""Required. The arguments to pass to the code execution."""
3535

3636
type: Required[Literal["code_execution_call"]]

google/genai/_interactions/types/code_execution_result_content.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class CodeExecutionResultContent(BaseModel):
3030
"""ID to match the ID from the code execution call block."""
3131

3232
result: str
33-
"""The output of the code execution."""
33+
"""Required. The output of the code execution."""
3434

3535
type: Literal["code_execution_result"]
3636

google/genai/_interactions/types/code_execution_result_content_param.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class CodeExecutionResultContentParam(TypedDict, total=False):
2929
"""ID to match the ID from the code execution call block."""
3030

3131
result: Required[str]
32-
"""The output of the code execution."""
32+
"""Required. The output of the code execution."""
3333

3434
type: Required[Literal["code_execution_result"]]
3535

google/genai/_interactions/types/content.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,16 +49,16 @@
4949
VideoContent,
5050
ThoughtContent,
5151
FunctionCallContent,
52-
FunctionResultContent,
5352
CodeExecutionCallContent,
54-
CodeExecutionResultContent,
5553
URLContextCallContent,
56-
URLContextResultContent,
54+
MCPServerToolCallContent,
5755
GoogleSearchCallContent,
56+
FileSearchCallContent,
57+
FunctionResultContent,
58+
CodeExecutionResultContent,
59+
URLContextResultContent,
5860
GoogleSearchResultContent,
59-
MCPServerToolCallContent,
6061
MCPServerToolResultContent,
61-
FileSearchCallContent,
6262
FileSearchResultContent,
6363
],
6464
PropertyInfo(discriminator="type"),

google/genai/_interactions/types/content_delta.py

Lines changed: 71 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -41,22 +41,18 @@
4141
"DeltaThoughtSummaryContent",
4242
"DeltaThoughtSignature",
4343
"DeltaFunctionCall",
44-
"DeltaFunctionResult",
45-
"DeltaFunctionResultResult",
46-
"DeltaFunctionResultResultItems",
47-
"DeltaFunctionResultResultItemsItem",
4844
"DeltaCodeExecutionCall",
49-
"DeltaCodeExecutionResult",
5045
"DeltaURLContextCall",
51-
"DeltaURLContextResult",
5246
"DeltaGoogleSearchCall",
53-
"DeltaGoogleSearchResult",
5447
"DeltaMCPServerToolCall",
55-
"DeltaMCPServerToolResult",
56-
"DeltaMCPServerToolResultResult",
57-
"DeltaMCPServerToolResultResultItems",
58-
"DeltaMCPServerToolResultResultItemsItem",
5948
"DeltaFileSearchCall",
49+
"DeltaFunctionResult",
50+
"DeltaFunctionResultResultFunctionResultSubcontentList",
51+
"DeltaCodeExecutionResult",
52+
"DeltaURLContextResult",
53+
"DeltaGoogleSearchResult",
54+
"DeltaMCPServerToolResult",
55+
"DeltaMCPServerToolResultResultFunctionResultSubcontentList",
6056
"DeltaFileSearchResult",
6157
"DeltaFileSearchResultResult",
6258
]
@@ -157,22 +153,66 @@ class DeltaFunctionCall(BaseModel):
157153
type: Literal["function_call"]
158154

159155

160-
DeltaFunctionResultResultItemsItem: TypeAlias = Union[TextContent, ImageContent]
156+
class DeltaCodeExecutionCall(BaseModel):
157+
id: str
158+
"""A unique ID for this specific tool call."""
159+
160+
arguments: CodeExecutionCallArguments
161+
"""The arguments to pass to the code execution."""
162+
163+
type: Literal["code_execution_call"]
164+
165+
166+
class DeltaURLContextCall(BaseModel):
167+
id: str
168+
"""A unique ID for this specific tool call."""
169+
170+
arguments: URLContextCallArguments
171+
"""The arguments to pass to the URL context."""
172+
173+
type: Literal["url_context_call"]
174+
175+
176+
class DeltaGoogleSearchCall(BaseModel):
177+
id: str
178+
"""A unique ID for this specific tool call."""
179+
180+
arguments: GoogleSearchCallArguments
181+
"""The arguments to pass to Google Search."""
182+
183+
type: Literal["google_search_call"]
184+
161185

186+
class DeltaMCPServerToolCall(BaseModel):
187+
id: str
188+
"""A unique ID for this specific tool call."""
189+
190+
arguments: Dict[str, object]
162191

163-
class DeltaFunctionResultResultItems(BaseModel):
164-
items: Optional[List[DeltaFunctionResultResultItemsItem]] = None
192+
name: str
165193

194+
server_name: str
166195

167-
DeltaFunctionResultResult: TypeAlias = Union[DeltaFunctionResultResultItems, str, object]
196+
type: Literal["mcp_server_tool_call"]
197+
198+
199+
class DeltaFileSearchCall(BaseModel):
200+
id: str
201+
"""A unique ID for this specific tool call."""
202+
203+
type: Literal["file_search_call"]
204+
205+
206+
DeltaFunctionResultResultFunctionResultSubcontentList: TypeAlias = Annotated[
207+
Union[TextContent, ImageContent], PropertyInfo(discriminator="type")
208+
]
168209

169210

170211
class DeltaFunctionResult(BaseModel):
171212
call_id: str
172213
"""ID to match the ID from the function call block."""
173214

174-
result: DeltaFunctionResultResult
175-
"""Tool call result delta."""
215+
result: Union[List[DeltaFunctionResultResultFunctionResultSubcontentList], str, object]
176216

177217
type: Literal["function_result"]
178218

@@ -184,16 +224,6 @@ class DeltaFunctionResult(BaseModel):
184224
"""A signature hash for backend validation."""
185225

186226

187-
class DeltaCodeExecutionCall(BaseModel):
188-
id: str
189-
"""A unique ID for this specific tool call."""
190-
191-
arguments: CodeExecutionCallArguments
192-
"""The arguments to pass to the code execution."""
193-
194-
type: Literal["code_execution_call"]
195-
196-
197227
class DeltaCodeExecutionResult(BaseModel):
198228
call_id: str
199229
"""ID to match the ID from the function call block."""
@@ -208,16 +238,6 @@ class DeltaCodeExecutionResult(BaseModel):
208238
"""A signature hash for backend validation."""
209239

210240

211-
class DeltaURLContextCall(BaseModel):
212-
id: str
213-
"""A unique ID for this specific tool call."""
214-
215-
arguments: URLContextCallArguments
216-
"""The arguments to pass to the URL context."""
217-
218-
type: Literal["url_context_call"]
219-
220-
221241
class DeltaURLContextResult(BaseModel):
222242
call_id: str
223243
"""ID to match the ID from the function call block."""
@@ -232,16 +252,6 @@ class DeltaURLContextResult(BaseModel):
232252
"""A signature hash for backend validation."""
233253

234254

235-
class DeltaGoogleSearchCall(BaseModel):
236-
id: str
237-
"""A unique ID for this specific tool call."""
238-
239-
arguments: GoogleSearchCallArguments
240-
"""The arguments to pass to Google Search."""
241-
242-
type: Literal["google_search_call"]
243-
244-
245255
class DeltaGoogleSearchResult(BaseModel):
246256
call_id: str
247257
"""ID to match the ID from the function call block."""
@@ -256,35 +266,16 @@ class DeltaGoogleSearchResult(BaseModel):
256266
"""A signature hash for backend validation."""
257267

258268

259-
class DeltaMCPServerToolCall(BaseModel):
260-
id: str
261-
"""A unique ID for this specific tool call."""
262-
263-
arguments: Dict[str, object]
264-
265-
name: str
266-
267-
server_name: str
268-
269-
type: Literal["mcp_server_tool_call"]
270-
271-
272-
DeltaMCPServerToolResultResultItemsItem: TypeAlias = Union[TextContent, ImageContent]
273-
274-
275-
class DeltaMCPServerToolResultResultItems(BaseModel):
276-
items: Optional[List[DeltaMCPServerToolResultResultItemsItem]] = None
277-
278-
279-
DeltaMCPServerToolResultResult: TypeAlias = Union[DeltaMCPServerToolResultResultItems, str, object]
269+
DeltaMCPServerToolResultResultFunctionResultSubcontentList: TypeAlias = Annotated[
270+
Union[TextContent, ImageContent], PropertyInfo(discriminator="type")
271+
]
280272

281273

282274
class DeltaMCPServerToolResult(BaseModel):
283275
call_id: str
284276
"""ID to match the ID from the function call block."""
285277

286-
result: DeltaMCPServerToolResultResult
287-
"""Tool call result delta."""
278+
result: Union[List[DeltaMCPServerToolResultResultFunctionResultSubcontentList], str, object]
288279

289280
type: Literal["mcp_server_tool_result"]
290281

@@ -296,13 +287,6 @@ class DeltaMCPServerToolResult(BaseModel):
296287
"""A signature hash for backend validation."""
297288

298289

299-
class DeltaFileSearchCall(BaseModel):
300-
id: str
301-
"""A unique ID for this specific tool call."""
302-
303-
type: Literal["file_search_call"]
304-
305-
306290
class DeltaFileSearchResultResult(BaseModel):
307291
"""The result of the File Search."""
308292

@@ -320,9 +304,9 @@ class DeltaFileSearchResult(BaseModel):
320304
call_id: str
321305
"""ID to match the ID from the function call block."""
322306

323-
type: Literal["file_search_result"]
307+
result: List[DeltaFileSearchResultResult]
324308

325-
result: Optional[List[DeltaFileSearchResultResult]] = None
309+
type: Literal["file_search_result"]
326310

327311
signature: Optional[str] = None
328312
"""A signature hash for backend validation."""
@@ -338,16 +322,16 @@ class DeltaFileSearchResult(BaseModel):
338322
DeltaThoughtSummary,
339323
DeltaThoughtSignature,
340324
DeltaFunctionCall,
341-
DeltaFunctionResult,
342325
DeltaCodeExecutionCall,
343-
DeltaCodeExecutionResult,
344326
DeltaURLContextCall,
345-
DeltaURLContextResult,
346327
DeltaGoogleSearchCall,
347-
DeltaGoogleSearchResult,
348328
DeltaMCPServerToolCall,
349-
DeltaMCPServerToolResult,
350329
DeltaFileSearchCall,
330+
DeltaFunctionResult,
331+
DeltaCodeExecutionResult,
332+
DeltaURLContextResult,
333+
DeltaGoogleSearchResult,
334+
DeltaMCPServerToolResult,
351335
DeltaFileSearchResult,
352336
],
353337
PropertyInfo(discriminator="type"),
@@ -356,12 +340,14 @@ class DeltaFileSearchResult(BaseModel):
356340

357341
class ContentDelta(BaseModel):
358342
delta: Delta
343+
"""The delta content data for a content block."""
359344

360345
event_type: Literal["content.delta"]
361346

362347
index: int
363348

364349
event_id: Optional[str] = None
365350
"""
366-
The event_id token to be used to resume the interaction stream, from this event.
351+
The event_id token to be used to resume the interaction stream, from
352+
this event.
367353
"""

google/genai/_interactions/types/content_param.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,15 @@
4949
VideoContentParam,
5050
ThoughtContentParam,
5151
FunctionCallContentParam,
52-
FunctionResultContentParam,
5352
CodeExecutionCallContentParam,
54-
CodeExecutionResultContentParam,
5553
URLContextCallContentParam,
56-
URLContextResultContentParam,
54+
MCPServerToolCallContentParam,
5755
GoogleSearchCallContentParam,
56+
FileSearchCallContentParam,
57+
FunctionResultContentParam,
58+
CodeExecutionResultContentParam,
59+
URLContextResultContentParam,
5860
GoogleSearchResultContentParam,
59-
MCPServerToolCallContentParam,
6061
MCPServerToolResultContentParam,
61-
FileSearchCallContentParam,
6262
FileSearchResultContentParam,
6363
]

google/genai/_interactions/types/content_start.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,6 @@ class ContentStart(BaseModel):
3434

3535
event_id: Optional[str] = None
3636
"""
37-
The event_id token to be used to resume the interaction stream, from this event.
37+
The event_id token to be used to resume the interaction stream, from
38+
this event.
3839
"""

google/genai/_interactions/types/content_stop.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,6 @@ class ContentStop(BaseModel):
3030

3131
event_id: Optional[str] = None
3232
"""
33-
The event_id token to be used to resume the interaction stream, from this event.
33+
The event_id token to be used to resume the interaction stream, from
34+
this event.
3435
"""

google/genai/_interactions/types/error_event.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,6 @@ class ErrorEvent(BaseModel):
4141

4242
event_id: Optional[str] = None
4343
"""
44-
The event_id token to be used to resume the interaction stream, from this event.
44+
The event_id token to be used to resume the interaction stream, from
45+
this event.
4546
"""

0 commit comments

Comments
 (0)