Skip to content

Commit 033c29c

Browse files
Annhiluccopybara-github
authored andcommitted
chore: Mark Interaction fields as required
PiperOrigin-RevId: 874258689
1 parent e0f3378 commit 033c29c

25 files changed

Lines changed: 166 additions & 164 deletions

google/genai/_interactions/types/code_execution_call_content.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515

1616
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
1717

18-
from typing import Optional
1918
from typing_extensions import Literal
2019

2120
from .._models import BaseModel
@@ -27,10 +26,10 @@
2726
class CodeExecutionCallContent(BaseModel):
2827
"""Code execution content."""
2928

30-
type: Literal["code_execution_call"]
31-
32-
id: Optional[str] = None
29+
id: str
3330
"""A unique ID for this specific tool call."""
3431

35-
arguments: Optional[CodeExecutionCallArguments] = None
32+
arguments: CodeExecutionCallArguments
3633
"""The arguments to pass to the code execution."""
34+
35+
type: Literal["code_execution_call"]

google/genai/_interactions/types/code_execution_call_content_param.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@
2727
class CodeExecutionCallContentParam(TypedDict, total=False):
2828
"""Code execution content."""
2929

30-
type: Required[Literal["code_execution_call"]]
31-
32-
id: str
30+
id: Required[str]
3331
"""A unique ID for this specific tool call."""
3432

35-
arguments: CodeExecutionCallArgumentsParam
33+
arguments: Required[CodeExecutionCallArgumentsParam]
3634
"""The arguments to pass to the code execution."""
35+
36+
type: Required[Literal["code_execution_call"]]

google/genai/_interactions/types/code_execution_result_content.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,16 @@
2626
class CodeExecutionResultContent(BaseModel):
2727
"""Code execution result content."""
2828

29-
type: Literal["code_execution_result"]
30-
31-
call_id: Optional[str] = None
29+
call_id: str
3230
"""ID to match the ID from the code execution call block."""
3331

32+
result: str
33+
"""The output of the code execution."""
34+
35+
type: Literal["code_execution_result"]
36+
3437
is_error: Optional[bool] = None
3538
"""Whether the code execution resulted in an error."""
3639

37-
result: Optional[str] = None
38-
"""The output of the code execution."""
39-
4040
signature: Optional[str] = None
4141
"""A signature hash for backend validation."""

google/genai/_interactions/types/code_execution_result_content_param.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,16 @@
2525
class CodeExecutionResultContentParam(TypedDict, total=False):
2626
"""Code execution result content."""
2727

28-
type: Required[Literal["code_execution_result"]]
29-
30-
call_id: str
28+
call_id: Required[str]
3129
"""ID to match the ID from the code execution call block."""
3230

31+
result: Required[str]
32+
"""The output of the code execution."""
33+
34+
type: Required[Literal["code_execution_result"]]
35+
3336
is_error: bool
3437
"""Whether the code execution resulted in an error."""
3538

36-
result: str
37-
"""The output of the code execution."""
38-
3939
signature: str
4040
"""A signature hash for backend validation."""

google/genai/_interactions/types/content_delta.py

Lines changed: 58 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,13 @@
6363

6464

6565
class DeltaTextDelta(BaseModel):
66+
text: str
67+
6668
type: Literal["text"]
6769

6870
annotations: Optional[List[Annotation]] = None
6971
"""Citation information for model-generated content."""
7072

71-
text: Optional[str] = None
72-
7373

7474
class DeltaImageDelta(BaseModel):
7575
type: Literal["image"]
@@ -149,14 +149,14 @@ class DeltaThoughtSignatureDelta(BaseModel):
149149

150150

151151
class DeltaFunctionCallDelta(BaseModel):
152-
type: Literal["function_call"]
153-
154-
id: Optional[str] = None
152+
id: str
155153
"""A unique ID for this specific tool call."""
156154

157-
arguments: Optional[Dict[str, object]] = None
155+
arguments: Dict[str, object]
158156

159-
name: Optional[str] = None
157+
name: str
158+
159+
type: Literal["function_call"]
160160

161161

162162
DeltaFunctionResultDeltaResultItemsItem: TypeAlias = Union[TextContent, ImageContent]
@@ -170,99 +170,99 @@ class DeltaFunctionResultDeltaResultItems(BaseModel):
170170

171171

172172
class DeltaFunctionResultDelta(BaseModel):
173-
type: Literal["function_result"]
174-
175-
call_id: Optional[str] = None
173+
call_id: str
176174
"""ID to match the ID from the function call block."""
177175

176+
result: DeltaFunctionResultDeltaResult
177+
"""Tool call result delta."""
178+
179+
type: Literal["function_result"]
180+
178181
is_error: Optional[bool] = None
179182

180183
name: Optional[str] = None
181184

182-
result: Optional[DeltaFunctionResultDeltaResult] = None
183-
"""Tool call result delta."""
184-
185185

186186
class DeltaCodeExecutionCallDelta(BaseModel):
187-
type: Literal["code_execution_call"]
188-
189-
id: Optional[str] = None
187+
id: str
190188
"""A unique ID for this specific tool call."""
191189

192-
arguments: Optional[CodeExecutionCallArguments] = None
190+
arguments: CodeExecutionCallArguments
193191
"""The arguments to pass to the code execution."""
194192

193+
type: Literal["code_execution_call"]
195194

196-
class DeltaCodeExecutionResultDelta(BaseModel):
197-
type: Literal["code_execution_result"]
198195

199-
call_id: Optional[str] = None
196+
class DeltaCodeExecutionResultDelta(BaseModel):
197+
call_id: str
200198
"""ID to match the ID from the function call block."""
201199

202-
is_error: Optional[bool] = None
200+
result: str
201+
202+
type: Literal["code_execution_result"]
203203

204-
result: Optional[str] = None
204+
is_error: Optional[bool] = None
205205

206206
signature: Optional[str] = None
207207

208208

209209
class DeltaURLContextCallDelta(BaseModel):
210-
type: Literal["url_context_call"]
211-
212-
id: Optional[str] = None
210+
id: str
213211
"""A unique ID for this specific tool call."""
214212

215-
arguments: Optional[URLContextCallArguments] = None
213+
arguments: URLContextCallArguments
216214
"""The arguments to pass to the URL context."""
217215

216+
type: Literal["url_context_call"]
217+
218218

219219
class DeltaURLContextResultDelta(BaseModel):
220-
type: Literal["url_context_result"]
221-
222-
call_id: Optional[str] = None
220+
call_id: str
223221
"""ID to match the ID from the function call block."""
224222

225-
is_error: Optional[bool] = None
223+
result: List[URLContextResult]
226224

227-
result: Optional[List[URLContextResult]] = None
225+
type: Literal["url_context_result"]
226+
227+
is_error: Optional[bool] = None
228228

229229
signature: Optional[str] = None
230230

231231

232232
class DeltaGoogleSearchCallDelta(BaseModel):
233-
type: Literal["google_search_call"]
234-
235-
id: Optional[str] = None
233+
id: str
236234
"""A unique ID for this specific tool call."""
237235

238-
arguments: Optional[GoogleSearchCallArguments] = None
236+
arguments: GoogleSearchCallArguments
239237
"""The arguments to pass to Google Search."""
240238

239+
type: Literal["google_search_call"]
241240

242-
class DeltaGoogleSearchResultDelta(BaseModel):
243-
type: Literal["google_search_result"]
244241

245-
call_id: Optional[str] = None
242+
class DeltaGoogleSearchResultDelta(BaseModel):
243+
call_id: str
246244
"""ID to match the ID from the function call block."""
247245

248-
is_error: Optional[bool] = None
246+
result: List[GoogleSearchResult]
247+
248+
type: Literal["google_search_result"]
249249

250-
result: Optional[List[GoogleSearchResult]] = None
250+
is_error: Optional[bool] = None
251251

252252
signature: Optional[str] = None
253253

254254

255255
class DeltaMCPServerToolCallDelta(BaseModel):
256-
type: Literal["mcp_server_tool_call"]
257-
258-
id: Optional[str] = None
256+
id: str
259257
"""A unique ID for this specific tool call."""
260258

261-
arguments: Optional[Dict[str, object]] = None
259+
arguments: Dict[str, object]
262260

263-
name: Optional[str] = None
261+
name: str
264262

265-
server_name: Optional[str] = None
263+
server_name: str
264+
265+
type: Literal["mcp_server_tool_call"]
266266

267267

268268
DeltaMCPServerToolResultDeltaResultItemsItem: TypeAlias = Union[TextContent, ImageContent]
@@ -276,25 +276,25 @@ class DeltaMCPServerToolResultDeltaResultItems(BaseModel):
276276

277277

278278
class DeltaMCPServerToolResultDelta(BaseModel):
279-
type: Literal["mcp_server_tool_result"]
280-
281-
call_id: Optional[str] = None
279+
call_id: str
282280
"""ID to match the ID from the function call block."""
283281

284-
name: Optional[str] = None
285-
286-
result: Optional[DeltaMCPServerToolResultDeltaResult] = None
282+
result: DeltaMCPServerToolResultDeltaResult
287283
"""Tool call result delta."""
288284

285+
type: Literal["mcp_server_tool_result"]
286+
287+
name: Optional[str] = None
288+
289289
server_name: Optional[str] = None
290290

291291

292292
class DeltaFileSearchCallDelta(BaseModel):
293-
type: Literal["file_search_call"]
294-
295-
id: Optional[str] = None
293+
id: str
296294
"""A unique ID for this specific tool call."""
297295

296+
type: Literal["file_search_call"]
297+
298298

299299
class DeltaFileSearchResultDeltaResult(BaseModel):
300300
"""The result of the File Search."""
@@ -342,13 +342,13 @@ class DeltaFileSearchResultDelta(BaseModel):
342342

343343

344344
class ContentDelta(BaseModel):
345+
delta: Delta
346+
345347
event_type: Literal["content.delta"]
346348

347-
delta: Optional[Delta] = None
349+
index: int
348350

349351
event_id: Optional[str] = None
350352
"""
351353
The event_id token to be used to resume the interaction stream, from this event.
352354
"""
353-
354-
index: Optional[int] = None

google/genai/_interactions/types/content_start.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@
2525

2626

2727
class ContentStart(BaseModel):
28+
content: Content
29+
"""The content of the response."""
30+
2831
event_type: Literal["content.start"]
2932

30-
content: Optional[Content] = None
31-
"""The content of the response."""
33+
index: int
3234

3335
event_id: Optional[str] = None
3436
"""
3537
The event_id token to be used to resume the interaction stream, from this event.
3638
"""
37-
38-
index: Optional[int] = None

google/genai/_interactions/types/content_stop.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@
2626
class ContentStop(BaseModel):
2727
event_type: Literal["content.stop"]
2828

29+
index: int
30+
2931
event_id: Optional[str] = None
3032
"""
3133
The event_id token to be used to resume the interaction stream, from this event.
3234
"""
33-
34-
index: Optional[int] = None

google/genai/_interactions/types/file_search_call_content.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515

1616
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
1717

18-
from typing import Optional
1918
from typing_extensions import Literal
2019

2120
from .._models import BaseModel
@@ -26,7 +25,7 @@
2625
class FileSearchCallContent(BaseModel):
2726
"""File Search content."""
2827

29-
type: Literal["file_search_call"]
30-
31-
id: Optional[str] = None
28+
id: str
3229
"""A unique ID for this specific tool call."""
30+
31+
type: Literal["file_search_call"]

google/genai/_interactions/types/file_search_call_content_param.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
class FileSearchCallContentParam(TypedDict, total=False):
2626
"""File Search content."""
2727

28-
type: Required[Literal["file_search_call"]]
29-
30-
id: str
28+
id: Required[str]
3129
"""A unique ID for this specific tool call."""
30+
31+
type: Required[Literal["file_search_call"]]

google/genai/_interactions/types/file_search_result_content.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ class Result(BaseModel):
3939
class FileSearchResultContent(BaseModel):
4040
"""File Search result content."""
4141

42+
call_id: str
43+
"""ID to match the ID from the file search call block."""
44+
4245
type: Literal["file_search_result"]
4346

4447
result: Optional[List[Result]] = None

0 commit comments

Comments
 (0)