Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions google/genai/_interactions/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ def auth_headers(self) -> dict[str, str]:
def default_headers(self) -> dict[str, str | Omit]:
return {
**super().default_headers,
"Api-Revision": "2026-05-20",
**self._custom_headers,
}

Expand Down Expand Up @@ -393,6 +394,7 @@ def auth_headers(self) -> dict[str, str]:
def default_headers(self) -> dict[str, str | Omit]:
return {
**super().default_headers,
"Api-Revision": "2026-05-20",
**self._custom_headers,
}

Expand Down
75 changes: 36 additions & 39 deletions google/genai/_interactions/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,24 @@

from __future__ import annotations

from .step import Step as Step
from .tool import Tool as Tool
from .turn import Turn as Turn
from .model import Model as Model
from .usage import Usage as Usage
from .content import Content as Content
from .webhook import Webhook as Webhook
from .function import Function as Function
from .annotation import Annotation as Annotation
from .step_param import StepParam as StepParam
from .tool_param import ToolParam as ToolParam
from .turn_param import TurnParam as TurnParam
from .error_event import ErrorEvent as ErrorEvent
from .interaction import Interaction as Interaction
from .model_param import ModelParam as ModelParam
from .usage_param import UsageParam as UsageParam
from .content_stop import ContentStop as ContentStop
from .image_config import ImageConfig as ImageConfig
from .text_content import TextContent as TextContent
from .thought_step import ThoughtStep as ThoughtStep
from .url_citation import URLCitation as URLCitation
from .allowed_tools import AllowedTools as AllowedTools
from .audio_content import AudioContent as AudioContent
Expand All @@ -49,14 +50,17 @@
from .signing_secret import SigningSecret as SigningSecret
from .thinking_level import ThinkingLevel as ThinkingLevel
from .webhook_config import WebhookConfig as WebhookConfig
from .thought_content import ThoughtContent as ThoughtContent
from .user_input_step import UserInputStep as UserInputStep
from .annotation_param import AnnotationParam as AnnotationParam
from .document_content import DocumentContent as DocumentContent
from .tool_choice_type import ToolChoiceType as ToolChoiceType
from .generation_config import GenerationConfig as GenerationConfig
from .model_output_step import ModelOutputStep as ModelOutputStep
from .function_call_step import FunctionCallStep as FunctionCallStep
from .google_maps_result import GoogleMapsResult as GoogleMapsResult
from .image_config_param import ImageConfigParam as ImageConfigParam
from .text_content_param import TextContentParam as TextContentParam
from .thought_step_param import ThoughtStepParam as ThoughtStepParam
from .tool_choice_config import ToolChoiceConfig as ToolChoiceConfig
from .url_citation_param import URLCitationParam as URLCitationParam
from .url_context_result import URLContextResult as URLContextResult
Expand All @@ -69,66 +73,59 @@
from .webhook_list_params import WebhookListParams as WebhookListParams
from .webhook_ping_params import WebhookPingParams as WebhookPingParams
from .dynamic_agent_config import DynamicAgentConfig as DynamicAgentConfig
from .function_result_step import FunctionResultStep as FunctionResultStep
from .google_search_result import GoogleSearchResult as GoogleSearchResult
from .place_citation_param import PlaceCitationParam as PlaceCitationParam
from .webhook_config_param import WebhookConfigParam as WebhookConfigParam
from .function_call_content import FunctionCallContent as FunctionCallContent
from .file_search_call_step import FileSearchCallStep as FileSearchCallStep
from .google_maps_call_step import GoogleMapsCallStep as GoogleMapsCallStep
from .interaction_sse_event import InteractionSSEEvent as InteractionSSEEvent
from .thought_content_param import ThoughtContentParam as ThoughtContentParam
from .url_context_call_step import URLContextCallStep as URLContextCallStep
from .user_input_step_param import UserInputStepParam as UserInputStepParam
from .webhook_create_params import WebhookCreateParams as WebhookCreateParams
from .webhook_list_response import WebhookListResponse as WebhookListResponse
from .webhook_ping_response import WebhookPingResponse as WebhookPingResponse
from .webhook_update_params import WebhookUpdateParams as WebhookUpdateParams
from .document_content_param import DocumentContentParam as DocumentContentParam
from .interaction_get_params import InteractionGetParams as InteractionGetParams
from .function_result_content import FunctionResultContent as FunctionResultContent
from .file_search_result_step import FileSearchResultStep as FileSearchResultStep
from .generation_config_param import GenerationConfigParam as GenerationConfigParam
from .google_maps_result_step import GoogleMapsResultStep as GoogleMapsResultStep
from .google_search_call_step import GoogleSearchCallStep as GoogleSearchCallStep
from .interaction_start_event import InteractionStartEvent as InteractionStartEvent
from .model_output_step_param import ModelOutputStepParam as ModelOutputStepParam
from .url_context_result_step import URLContextResultStep as URLContextResultStep
from .webhook_delete_response import WebhookDeleteResponse as WebhookDeleteResponse
from .file_search_call_content import FileSearchCallContent as FileSearchCallContent
from .google_maps_call_content import GoogleMapsCallContent as GoogleMapsCallContent
from .google_maps_result_param import GoogleMapsResultParam as GoogleMapsResultParam
from .code_execution_call_step import CodeExecutionCallStep as CodeExecutionCallStep
from .function_call_step_param import FunctionCallStepParam as FunctionCallStepParam
from .tool_choice_config_param import ToolChoiceConfigParam as ToolChoiceConfigParam
from .url_context_call_content import URLContextCallContent as URLContextCallContent
from .url_context_result_param import URLContextResultParam as URLContextResultParam
from .google_search_result_step import GoogleSearchResultStep as GoogleSearchResultStep
from .interaction_create_params import InteractionCreateParams as InteractionCreateParams
from .interaction_status_update import InteractionStatusUpdate as InteractionStatusUpdate
from .mcp_server_tool_call_step import MCPServerToolCallStep as MCPServerToolCallStep
from .code_execution_result_step import CodeExecutionResultStep as CodeExecutionResultStep
from .deep_research_agent_config import DeepResearchAgentConfig as DeepResearchAgentConfig
from .dynamic_agent_config_param import DynamicAgentConfigParam as DynamicAgentConfigParam
from .file_search_result_content import FileSearchResultContent as FileSearchResultContent
from .function_result_step_param import FunctionResultStepParam as FunctionResultStepParam
from .google_maps_call_arguments import GoogleMapsCallArguments as GoogleMapsCallArguments
from .google_maps_result_content import GoogleMapsResultContent as GoogleMapsResultContent
from .google_search_call_content import GoogleSearchCallContent as GoogleSearchCallContent
from .google_search_result_param import GoogleSearchResultParam as GoogleSearchResultParam
from .interaction_complete_event import InteractionCompleteEvent as InteractionCompleteEvent
from .url_context_call_arguments import URLContextCallArguments as URLContextCallArguments
from .url_context_result_content import URLContextResultContent as URLContextResultContent
from .code_execution_call_content import CodeExecutionCallContent as CodeExecutionCallContent
from .function_call_content_param import FunctionCallContentParam as FunctionCallContentParam
from .file_search_call_step_param import FileSearchCallStepParam as FileSearchCallStepParam
from .google_maps_call_step_param import GoogleMapsCallStepParam as GoogleMapsCallStepParam
from .mcp_server_tool_result_step import MCPServerToolResultStep as MCPServerToolResultStep
from .url_context_call_step_param import URLContextCallStepParam as URLContextCallStepParam
from .google_search_call_arguments import GoogleSearchCallArguments as GoogleSearchCallArguments
from .google_search_result_content import GoogleSearchResultContent as GoogleSearchResultContent
from .mcp_server_tool_call_content import MCPServerToolCallContent as MCPServerToolCallContent
from .code_execution_call_arguments import CodeExecutionCallArguments as CodeExecutionCallArguments
from .code_execution_result_content import CodeExecutionResultContent as CodeExecutionResultContent
from .function_result_content_param import FunctionResultContentParam as FunctionResultContentParam
from .file_search_call_content_param import FileSearchCallContentParam as FileSearchCallContentParam
from .google_maps_call_content_param import GoogleMapsCallContentParam as GoogleMapsCallContentParam
from .mcp_server_tool_result_content import MCPServerToolResultContent as MCPServerToolResultContent
from .url_context_call_content_param import URLContextCallContentParam as URLContextCallContentParam
from .file_search_result_step_param import FileSearchResultStepParam as FileSearchResultStepParam
from .google_maps_result_step_param import GoogleMapsResultStepParam as GoogleMapsResultStepParam
from .google_search_call_step_param import GoogleSearchCallStepParam as GoogleSearchCallStepParam
from .url_context_result_step_param import URLContextResultStepParam as URLContextResultStepParam
from .code_execution_call_step_param import CodeExecutionCallStepParam as CodeExecutionCallStepParam
from .google_search_result_step_param import GoogleSearchResultStepParam as GoogleSearchResultStepParam
from .mcp_server_tool_call_step_param import MCPServerToolCallStepParam as MCPServerToolCallStepParam
from .code_execution_result_step_param import CodeExecutionResultStepParam as CodeExecutionResultStepParam
from .deep_research_agent_config_param import DeepResearchAgentConfigParam as DeepResearchAgentConfigParam
from .file_search_result_content_param import FileSearchResultContentParam as FileSearchResultContentParam
from .google_maps_call_arguments_param import GoogleMapsCallArgumentsParam as GoogleMapsCallArgumentsParam
from .google_maps_result_content_param import GoogleMapsResultContentParam as GoogleMapsResultContentParam
from .google_search_call_content_param import GoogleSearchCallContentParam as GoogleSearchCallContentParam
from .url_context_call_arguments_param import URLContextCallArgumentsParam as URLContextCallArgumentsParam
from .url_context_result_content_param import URLContextResultContentParam as URLContextResultContentParam
from .code_execution_call_content_param import CodeExecutionCallContentParam as CodeExecutionCallContentParam
from .google_search_call_arguments_param import GoogleSearchCallArgumentsParam as GoogleSearchCallArgumentsParam
from .google_search_result_content_param import GoogleSearchResultContentParam as GoogleSearchResultContentParam
from .mcp_server_tool_call_content_param import MCPServerToolCallContentParam as MCPServerToolCallContentParam
from .code_execution_call_arguments_param import CodeExecutionCallArgumentsParam as CodeExecutionCallArgumentsParam
from .code_execution_result_content_param import CodeExecutionResultContentParam as CodeExecutionResultContentParam
from .mcp_server_tool_result_content_param import MCPServerToolResultContentParam as MCPServerToolResultContentParam
from .mcp_server_tool_result_step_param import MCPServerToolResultStepParam as MCPServerToolResultStepParam
from .webhook_rotate_signing_secret_params import WebhookRotateSigningSecretParams as WebhookRotateSigningSecretParams
from .webhook_rotate_signing_secret_response import (
WebhookRotateSigningSecretResponse as WebhookRotateSigningSecretResponse,
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,27 @@
from typing_extensions import Literal

from .._models import BaseModel
from .code_execution_call_arguments import CodeExecutionCallArguments

__all__ = ["CodeExecutionCallContent"]
__all__ = ["CodeExecutionCallStep", "Arguments"]


class CodeExecutionCallContent(BaseModel):
"""Code execution content."""
class Arguments(BaseModel):
"""Required. The arguments to pass to the code execution."""

code: Optional[str] = None
"""The code to be executed."""

language: Optional[Literal["python"]] = None
"""Programming language of the `code`."""


class CodeExecutionCallStep(BaseModel):
"""Code execution call step."""

id: str
"""Required. A unique ID for this specific tool call."""

arguments: CodeExecutionCallArguments
arguments: Arguments
"""Required. The arguments to pass to the code execution."""

type: Literal["code_execution_call"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,27 @@
from .._types import Base64FileInput
from .._utils import PropertyInfo
from .._models import set_pydantic_config
from .code_execution_call_arguments_param import CodeExecutionCallArgumentsParam

__all__ = ["CodeExecutionCallContentParam"]
__all__ = ["CodeExecutionCallStepParam", "Arguments"]


class CodeExecutionCallContentParam(TypedDict, total=False):
"""Code execution content."""
class Arguments(TypedDict, total=False):
"""Required. The arguments to pass to the code execution."""

code: str
"""The code to be executed."""

language: Literal["python"]
"""Programming language of the `code`."""


class CodeExecutionCallStepParam(TypedDict, total=False):
"""Code execution call step."""

id: Required[str]
"""Required. A unique ID for this specific tool call."""

arguments: Required[CodeExecutionCallArgumentsParam]
arguments: Required[Arguments]
"""Required. The arguments to pass to the code execution."""

type: Required[Literal["code_execution_call"]]
Expand All @@ -43,4 +52,4 @@ class CodeExecutionCallContentParam(TypedDict, total=False):
"""A signature hash for backend validation."""


set_pydantic_config(CodeExecutionCallContentParam, {"arbitrary_types_allowed": True})
set_pydantic_config(CodeExecutionCallStepParam, {"arbitrary_types_allowed": True})
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@

from .._models import BaseModel

__all__ = ["CodeExecutionResultContent"]
__all__ = ["CodeExecutionResultStep"]


class CodeExecutionResultContent(BaseModel):
"""Code execution result content."""
class CodeExecutionResultStep(BaseModel):
"""Code execution result step."""

call_id: str
"""Required. ID to match the ID from the function call block."""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@
from .._utils import PropertyInfo
from .._models import set_pydantic_config

__all__ = ["CodeExecutionResultContentParam"]
__all__ = ["CodeExecutionResultStepParam"]


class CodeExecutionResultContentParam(TypedDict, total=False):
"""Code execution result content."""
class CodeExecutionResultStepParam(TypedDict, total=False):
"""Code execution result step."""

call_id: Required[str]
"""Required. ID to match the ID from the function call block."""
Expand All @@ -45,4 +45,4 @@ class CodeExecutionResultContentParam(TypedDict, total=False):
"""A signature hash for backend validation."""


set_pydantic_config(CodeExecutionResultContentParam, {"arbitrary_types_allowed": True})
set_pydantic_config(CodeExecutionResultStepParam, {"arbitrary_types_allowed": True})
39 changes: 1 addition & 38 deletions google/genai/_interactions/types/content.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,47 +23,10 @@
from .audio_content import AudioContent
from .image_content import ImageContent
from .video_content import VideoContent
from .thought_content import ThoughtContent
from .document_content import DocumentContent
from .function_call_content import FunctionCallContent
from .function_result_content import FunctionResultContent
from .file_search_call_content import FileSearchCallContent
from .google_maps_call_content import GoogleMapsCallContent
from .url_context_call_content import URLContextCallContent
from .file_search_result_content import FileSearchResultContent
from .google_maps_result_content import GoogleMapsResultContent
from .google_search_call_content import GoogleSearchCallContent
from .url_context_result_content import URLContextResultContent
from .code_execution_call_content import CodeExecutionCallContent
from .google_search_result_content import GoogleSearchResultContent
from .mcp_server_tool_call_content import MCPServerToolCallContent
from .code_execution_result_content import CodeExecutionResultContent
from .mcp_server_tool_result_content import MCPServerToolResultContent

__all__ = ["Content"]

Content: TypeAlias = Annotated[
Union[
TextContent,
ImageContent,
AudioContent,
DocumentContent,
VideoContent,
ThoughtContent,
FunctionCallContent,
CodeExecutionCallContent,
URLContextCallContent,
MCPServerToolCallContent,
GoogleSearchCallContent,
FileSearchCallContent,
GoogleMapsCallContent,
FunctionResultContent,
CodeExecutionResultContent,
URLContextResultContent,
GoogleSearchResultContent,
MCPServerToolResultContent,
FileSearchResultContent,
GoogleMapsResultContent,
],
PropertyInfo(discriminator="type"),
Union[TextContent, ImageContent, AudioContent, DocumentContent, VideoContent], PropertyInfo(discriminator="type")
]
8 changes: 4 additions & 4 deletions google/genai/_interactions/types/content_delta.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"DeltaMCPServerToolResultResultFunctionResultSubcontentList",
"DeltaFileSearchResult",
"DeltaGoogleMapsResult",
"DeltaTextAnnotation",
"DeltaTextAnnotationDelta",
]


Expand Down Expand Up @@ -372,8 +372,8 @@ class DeltaGoogleMapsResult(BaseModel):
"""A signature hash for backend validation."""


class DeltaTextAnnotation(BaseModel):
type: Literal["text_annotation"]
class DeltaTextAnnotationDelta(BaseModel):
type: Literal["text_annotation_delta"]

annotations: Optional[List[Annotation]] = None
"""Citation information for model-generated content."""
Expand Down Expand Up @@ -402,7 +402,7 @@ class DeltaTextAnnotation(BaseModel):
DeltaMCPServerToolResult,
DeltaFileSearchResult,
DeltaGoogleMapsResult,
DeltaTextAnnotation,
DeltaTextAnnotationDelta,
],
PropertyInfo(discriminator="type"),
]
Expand Down
Loading
Loading