diff --git a/google/genai/_gaos/resources/interactions/__init__.py b/google/genai/_gaos/resources/interactions/__init__.py index 87216d45d..5f82bb4b6 100644 --- a/google/genai/_gaos/resources/interactions/__init__.py +++ b/google/genai/_gaos/resources/interactions/__init__.py @@ -80,6 +80,8 @@ from ...types.interactions.model import Model from ...types.interactions.modeloutputstep import ModelOutputStep from ...types.interactions.placecitation import PlaceCitation +from ...types.interactions.processingcallstep import ProcessingCallStep +from ...types.interactions.processingresultstep import ProcessingResultStep from ...types.interactions.retrievalcallarguments import RetrievalCallArguments from ...types.interactions.retrievalcalldelta import RetrievalCallDelta from ...types.interactions.retrievalresultdelta import RetrievalResultDelta @@ -186,6 +188,8 @@ "Model", "ModelOutputStep", "PlaceCitation", + "ProcessingCallStep", + "ProcessingResultStep", "RetrievalCallArguments", "RetrievalCallDelta", "RetrievalResultDelta", diff --git a/google/genai/_gaos/types/interactions/__init__.py b/google/genai/_gaos/types/interactions/__init__.py index c8f2b90fb..c71739cc5 100644 --- a/google/genai/_gaos/types/interactions/__init__.py +++ b/google/genai/_gaos/types/interactions/__init__.py @@ -303,10 +303,12 @@ ) from .placecitation import PlaceCitation, PlaceCitationParam from .processingcalldelta import ProcessingCallDelta, ProcessingCallDeltaTypedDict + from .processingcallstep import ProcessingCallStep, ProcessingCallStepParam from .processingresultdelta import ( ProcessingResultDelta, ProcessingResultDeltaTypedDict, ) + from .processingresultstep import ProcessingResultStep, ProcessingResultStepParam from .ragresource import RagResource, RagResourceParam from .ragretrievalconfig import RagRetrievalConfig, RagRetrievalConfigParam from .ragstoreconfig import RagStoreConfig, RagStoreConfigParam @@ -672,10 +674,14 @@ "Processing", "ProcessingCallDelta", "ProcessingCallDeltaTypedDict", + "ProcessingCallStep", + "ProcessingCallStepParam", "ProcessingEnum", "ProcessingParam", "ProcessingResultDelta", "ProcessingResultDeltaTypedDict", + "ProcessingResultStep", + "ProcessingResultStepParam", "RagResource", "RagResourceParam", "RagRetrievalConfig", @@ -1074,8 +1080,12 @@ "PlaceCitationParam": ".placecitation", "ProcessingCallDelta": ".processingcalldelta", "ProcessingCallDeltaTypedDict": ".processingcalldelta", + "ProcessingCallStep": ".processingcallstep", + "ProcessingCallStepParam": ".processingcallstep", "ProcessingResultDelta": ".processingresultdelta", "ProcessingResultDeltaTypedDict": ".processingresultdelta", + "ProcessingResultStep": ".processingresultstep", + "ProcessingResultStepParam": ".processingresultstep", "RagResource": ".ragresource", "RagResourceParam": ".ragresource", "RagRetrievalConfig": ".ragretrievalconfig", diff --git a/google/genai/_gaos/types/interactions/processingcallstep.py b/google/genai/_gaos/types/interactions/processingcallstep.py new file mode 100644 index 000000000..a6894c0b7 --- /dev/null +++ b/google/genai/_gaos/types/interactions/processingcallstep.py @@ -0,0 +1,85 @@ +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# pyformat: disable + +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .. import ( + Base64EncodedString, + Base64FileInput, + BaseModel, + UNSET_SENTINEL, +) +from ...utils import validate_const +import pydantic +from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator +from typing import Literal, Optional, Union +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ProcessingCallStepParam(TypedDict): + r"""A server-initiated processing step for media analysis (e.g. video + understanding). + """ + + id: str + r"""Required. A unique ID for this specific tool call.""" + signature: NotRequired[Union[str, Base64FileInput]] + r"""A signature hash for backend validation.""" + type: Literal["processing_call"] + + +class ProcessingCallStep(BaseModel): + r"""A server-initiated processing step for media analysis (e.g. video + understanding). + """ + + id: str + r"""Required. A unique ID for this specific tool call.""" + + signature: Optional[Base64EncodedString] = None + r"""A signature hash for backend validation.""" + + type: Annotated[ + Annotated[ + Literal["processing_call"], + AfterValidator(validate_const("processing_call")), + ], + pydantic.Field(alias="type"), + ] = "processing_call" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["signature"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m + + +try: + ProcessingCallStep.model_rebuild() +except NameError: + pass diff --git a/google/genai/_gaos/types/interactions/processingresultstep.py b/google/genai/_gaos/types/interactions/processingresultstep.py new file mode 100644 index 000000000..dc8b9c97c --- /dev/null +++ b/google/genai/_gaos/types/interactions/processingresultstep.py @@ -0,0 +1,81 @@ +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# pyformat: disable + +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .. import ( + Base64EncodedString, + Base64FileInput, + BaseModel, + UNSET_SENTINEL, +) +from ...utils import validate_const +import pydantic +from pydantic import model_serializer +from pydantic.functional_validators import AfterValidator +from typing import Literal, Optional, Union +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ProcessingResultStepParam(TypedDict): + r"""The result of a server-initiated media processing step.""" + + call_id: str + r"""Required. ID to match the ID from the function call block.""" + signature: NotRequired[Union[str, Base64FileInput]] + r"""A signature hash for backend validation.""" + type: Literal["processing_result"] + + +class ProcessingResultStep(BaseModel): + r"""The result of a server-initiated media processing step.""" + + call_id: str + r"""Required. ID to match the ID from the function call block.""" + + signature: Optional[Base64EncodedString] = None + r"""A signature hash for backend validation.""" + + type: Annotated[ + Annotated[ + Literal["processing_result"], + AfterValidator(validate_const("processing_result")), + ], + pydantic.Field(alias="type"), + ] = "processing_result" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["signature"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m + + +try: + ProcessingResultStep.model_rebuild() +except NameError: + pass diff --git a/google/genai/_gaos/types/interactions/step.py b/google/genai/_gaos/types/interactions/step.py index 567268155..2a0a12a50 100644 --- a/google/genai/_gaos/types/interactions/step.py +++ b/google/genai/_gaos/types/interactions/step.py @@ -36,6 +36,8 @@ MCPServerToolResultStepParam, ) from .modeloutputstep import ModelOutputStep, ModelOutputStepParam +from .processingcallstep import ProcessingCallStep, ProcessingCallStepParam +from .processingresultstep import ProcessingResultStep, ProcessingResultStepParam from .thoughtstep import ThoughtStep, ThoughtStepParam from .urlcontextcallstep import URLContextCallStep, URLContextCallStepParam from .urlcontextresultstep import URLContextResultStep, URLContextResultStepParam @@ -57,9 +59,11 @@ FileSearchCallStepParam, FileSearchResultStepParam, ThoughtStepParam, + ProcessingResultStepParam, + ProcessingCallStepParam, FunctionCallStepParam, - GoogleMapsCallStepParam, GoogleMapsResultStepParam, + GoogleMapsCallStepParam, CodeExecutionCallStepParam, URLContextCallStepParam, GoogleSearchCallStepParam, @@ -98,6 +102,8 @@ class UnknownStep(BaseModel): "mcp_server_tool_call": MCPServerToolCallStep, "mcp_server_tool_result": MCPServerToolResultStep, "model_output": ModelOutputStep, + "processing_call": ProcessingCallStep, + "processing_result": ProcessingResultStep, "thought": ThoughtStep, "url_context_call": URLContextCallStep, "url_context_result": URLContextResultStep, @@ -120,6 +126,8 @@ class UnknownStep(BaseModel): MCPServerToolCallStep, MCPServerToolResultStep, ModelOutputStep, + ProcessingCallStep, + ProcessingResultStep, ThoughtStep, URLContextCallStep, URLContextResultStep,