Skip to content

Commit f99b328

Browse files
MarkDaoustcopybara-github
authored andcommitted
fix: expose ProcessingCallStep and ProcessingResultStep in Interactions SDK
PiperOrigin-RevId: 972222302
1 parent 2cc99a9 commit f99b328

5 files changed

Lines changed: 189 additions & 1 deletion

File tree

google/genai/_gaos/resources/interactions/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@
8080
from ...types.interactions.model import Model
8181
from ...types.interactions.modeloutputstep import ModelOutputStep
8282
from ...types.interactions.placecitation import PlaceCitation
83+
from ...types.interactions.processingcallstep import ProcessingCallStep
84+
from ...types.interactions.processingresultstep import ProcessingResultStep
8385
from ...types.interactions.retrievalcallarguments import RetrievalCallArguments
8486
from ...types.interactions.retrievalcalldelta import RetrievalCallDelta
8587
from ...types.interactions.retrievalresultdelta import RetrievalResultDelta
@@ -186,6 +188,8 @@
186188
"Model",
187189
"ModelOutputStep",
188190
"PlaceCitation",
191+
"ProcessingCallStep",
192+
"ProcessingResultStep",
189193
"RetrievalCallArguments",
190194
"RetrievalCallDelta",
191195
"RetrievalResultDelta",

google/genai/_gaos/types/interactions/__init__.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,10 +303,12 @@
303303
)
304304
from .placecitation import PlaceCitation, PlaceCitationParam
305305
from .processingcalldelta import ProcessingCallDelta, ProcessingCallDeltaTypedDict
306+
from .processingcallstep import ProcessingCallStep, ProcessingCallStepParam
306307
from .processingresultdelta import (
307308
ProcessingResultDelta,
308309
ProcessingResultDeltaTypedDict,
309310
)
311+
from .processingresultstep import ProcessingResultStep, ProcessingResultStepParam
310312
from .ragresource import RagResource, RagResourceParam
311313
from .ragretrievalconfig import RagRetrievalConfig, RagRetrievalConfigParam
312314
from .ragstoreconfig import RagStoreConfig, RagStoreConfigParam
@@ -672,10 +674,14 @@
672674
"Processing",
673675
"ProcessingCallDelta",
674676
"ProcessingCallDeltaTypedDict",
677+
"ProcessingCallStep",
678+
"ProcessingCallStepParam",
675679
"ProcessingEnum",
676680
"ProcessingParam",
677681
"ProcessingResultDelta",
678682
"ProcessingResultDeltaTypedDict",
683+
"ProcessingResultStep",
684+
"ProcessingResultStepParam",
679685
"RagResource",
680686
"RagResourceParam",
681687
"RagRetrievalConfig",
@@ -1074,8 +1080,12 @@
10741080
"PlaceCitationParam": ".placecitation",
10751081
"ProcessingCallDelta": ".processingcalldelta",
10761082
"ProcessingCallDeltaTypedDict": ".processingcalldelta",
1083+
"ProcessingCallStep": ".processingcallstep",
1084+
"ProcessingCallStepParam": ".processingcallstep",
10771085
"ProcessingResultDelta": ".processingresultdelta",
10781086
"ProcessingResultDeltaTypedDict": ".processingresultdelta",
1087+
"ProcessingResultStep": ".processingresultstep",
1088+
"ProcessingResultStepParam": ".processingresultstep",
10791089
"RagResource": ".ragresource",
10801090
"RagResourceParam": ".ragresource",
10811091
"RagRetrievalConfig": ".ragretrievalconfig",
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
# Copyright 2026 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
#
15+
# pyformat: disable
16+
17+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
18+
19+
from __future__ import annotations
20+
from .. import (
21+
Base64EncodedString,
22+
Base64FileInput,
23+
BaseModel,
24+
UNSET_SENTINEL,
25+
)
26+
from ...utils import validate_const
27+
import pydantic
28+
from pydantic import model_serializer
29+
from pydantic.functional_validators import AfterValidator
30+
from typing import Literal, Optional, Union
31+
from typing_extensions import Annotated, NotRequired, TypedDict
32+
33+
34+
class ProcessingCallStepParam(TypedDict):
35+
r"""A server-initiated processing step for media analysis (e.g. video
36+
understanding).
37+
"""
38+
39+
id: str
40+
r"""Required. A unique ID for this specific tool call."""
41+
signature: NotRequired[Union[str, Base64FileInput]]
42+
r"""A signature hash for backend validation."""
43+
type: Literal["processing_call"]
44+
45+
46+
class ProcessingCallStep(BaseModel):
47+
r"""A server-initiated processing step for media analysis (e.g. video
48+
understanding).
49+
"""
50+
51+
id: str
52+
r"""Required. A unique ID for this specific tool call."""
53+
54+
signature: Optional[Base64EncodedString] = None
55+
r"""A signature hash for backend validation."""
56+
57+
type: Annotated[
58+
Annotated[
59+
Literal["processing_call"],
60+
AfterValidator(validate_const("processing_call")),
61+
],
62+
pydantic.Field(alias="type"),
63+
] = "processing_call"
64+
65+
@model_serializer(mode="wrap")
66+
def serialize_model(self, handler):
67+
optional_fields = set(["signature"])
68+
serialized = handler(self)
69+
m = {}
70+
71+
for n, f in type(self).model_fields.items():
72+
k = f.alias or n
73+
val = serialized.get(k, serialized.get(n))
74+
75+
if val != UNSET_SENTINEL:
76+
if val is not None or k not in optional_fields:
77+
m[k] = val
78+
79+
return m
80+
81+
82+
try:
83+
ProcessingCallStep.model_rebuild()
84+
except NameError:
85+
pass
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# Copyright 2026 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
#
15+
# pyformat: disable
16+
17+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
18+
19+
from __future__ import annotations
20+
from .. import (
21+
Base64EncodedString,
22+
Base64FileInput,
23+
BaseModel,
24+
UNSET_SENTINEL,
25+
)
26+
from ...utils import validate_const
27+
import pydantic
28+
from pydantic import model_serializer
29+
from pydantic.functional_validators import AfterValidator
30+
from typing import Literal, Optional, Union
31+
from typing_extensions import Annotated, NotRequired, TypedDict
32+
33+
34+
class ProcessingResultStepParam(TypedDict):
35+
r"""The result of a server-initiated media processing step."""
36+
37+
call_id: str
38+
r"""Required. ID to match the ID from the function call block."""
39+
signature: NotRequired[Union[str, Base64FileInput]]
40+
r"""A signature hash for backend validation."""
41+
type: Literal["processing_result"]
42+
43+
44+
class ProcessingResultStep(BaseModel):
45+
r"""The result of a server-initiated media processing step."""
46+
47+
call_id: str
48+
r"""Required. ID to match the ID from the function call block."""
49+
50+
signature: Optional[Base64EncodedString] = None
51+
r"""A signature hash for backend validation."""
52+
53+
type: Annotated[
54+
Annotated[
55+
Literal["processing_result"],
56+
AfterValidator(validate_const("processing_result")),
57+
],
58+
pydantic.Field(alias="type"),
59+
] = "processing_result"
60+
61+
@model_serializer(mode="wrap")
62+
def serialize_model(self, handler):
63+
optional_fields = set(["signature"])
64+
serialized = handler(self)
65+
m = {}
66+
67+
for n, f in type(self).model_fields.items():
68+
k = f.alias or n
69+
val = serialized.get(k, serialized.get(n))
70+
71+
if val != UNSET_SENTINEL:
72+
if val is not None or k not in optional_fields:
73+
m[k] = val
74+
75+
return m
76+
77+
78+
try:
79+
ProcessingResultStep.model_rebuild()
80+
except NameError:
81+
pass

google/genai/_gaos/types/interactions/step.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@
3636
MCPServerToolResultStepParam,
3737
)
3838
from .modeloutputstep import ModelOutputStep, ModelOutputStepParam
39+
from .processingcallstep import ProcessingCallStep, ProcessingCallStepParam
40+
from .processingresultstep import ProcessingResultStep, ProcessingResultStepParam
3941
from .thoughtstep import ThoughtStep, ThoughtStepParam
4042
from .urlcontextcallstep import URLContextCallStep, URLContextCallStepParam
4143
from .urlcontextresultstep import URLContextResultStep, URLContextResultStepParam
@@ -57,9 +59,11 @@
5759
FileSearchCallStepParam,
5860
FileSearchResultStepParam,
5961
ThoughtStepParam,
62+
ProcessingResultStepParam,
63+
ProcessingCallStepParam,
6064
FunctionCallStepParam,
61-
GoogleMapsCallStepParam,
6265
GoogleMapsResultStepParam,
66+
GoogleMapsCallStepParam,
6367
CodeExecutionCallStepParam,
6468
URLContextCallStepParam,
6569
GoogleSearchCallStepParam,
@@ -98,6 +102,8 @@ class UnknownStep(BaseModel):
98102
"mcp_server_tool_call": MCPServerToolCallStep,
99103
"mcp_server_tool_result": MCPServerToolResultStep,
100104
"model_output": ModelOutputStep,
105+
"processing_call": ProcessingCallStep,
106+
"processing_result": ProcessingResultStep,
101107
"thought": ThoughtStep,
102108
"url_context_call": URLContextCallStep,
103109
"url_context_result": URLContextResultStep,
@@ -120,6 +126,8 @@ class UnknownStep(BaseModel):
120126
MCPServerToolCallStep,
121127
MCPServerToolResultStep,
122128
ModelOutputStep,
129+
ProcessingCallStep,
130+
ProcessingResultStep,
123131
ThoughtStep,
124132
URLContextCallStep,
125133
URLContextResultStep,

0 commit comments

Comments
 (0)