From f4bcca45e0805c798ee86530e013a0c325d0af85 Mon Sep 17 00:00:00 2001 From: Kaituo Huang Date: Tue, 24 Mar 2026 01:58:37 -0700 Subject: [PATCH] chore: update comment PiperOrigin-RevId: 888526820 --- .../types/code_execution_call_content.py | 2 +- .../types/code_execution_call_content_param.py | 2 +- .../types/code_execution_result_content.py | 2 +- .../types/code_execution_result_content_param.py | 2 +- google/genai/_interactions/types/content_delta.py | 10 +++++----- .../types/file_search_result_content.py | 6 +++--- .../types/file_search_result_content_param.py | 6 +++--- .../_interactions/types/function_call_content.py | 4 ++-- .../types/function_call_content_param.py | 4 ++-- .../types/google_maps_result_content.py | 2 +- .../types/google_maps_result_content_param.py | 2 +- .../types/google_search_call_content.py | 2 +- .../types/google_search_call_content_param.py | 2 +- .../types/google_search_result_content.py | 2 +- .../types/google_search_result_content_param.py | 2 +- google/genai/_interactions/types/interaction.py | 12 ++++++------ .../types/interaction_complete_event.py | 3 ++- .../types/mcp_server_tool_call_content.py | 6 +++--- .../types/mcp_server_tool_call_content_param.py | 6 +++--- google/genai/_interactions/types/text_content.py | 2 +- .../genai/_interactions/types/text_content_param.py | 2 +- google/genai/_interactions/types/tool.py | 4 ++-- google/genai/_interactions/types/tool_param.py | 4 ++-- .../_interactions/types/url_context_call_content.py | 2 +- .../types/url_context_call_content_param.py | 2 +- .../types/url_context_result_content.py | 2 +- .../types/url_context_result_content_param.py | 2 +- 27 files changed, 49 insertions(+), 48 deletions(-) diff --git a/google/genai/_interactions/types/code_execution_call_content.py b/google/genai/_interactions/types/code_execution_call_content.py index af84a4837..980cbee7b 100644 --- a/google/genai/_interactions/types/code_execution_call_content.py +++ b/google/genai/_interactions/types/code_execution_call_content.py @@ -31,7 +31,7 @@ class CodeExecutionCallContent(BaseModel): """A unique ID for this specific tool call.""" arguments: CodeExecutionCallArguments - """The arguments to pass to the code execution.""" + """Required. The arguments to pass to the code execution.""" type: Literal["code_execution_call"] diff --git a/google/genai/_interactions/types/code_execution_call_content_param.py b/google/genai/_interactions/types/code_execution_call_content_param.py index 68b621045..f5a9137b6 100644 --- a/google/genai/_interactions/types/code_execution_call_content_param.py +++ b/google/genai/_interactions/types/code_execution_call_content_param.py @@ -35,7 +35,7 @@ class CodeExecutionCallContentParam(TypedDict, total=False): """A unique ID for this specific tool call.""" arguments: Required[CodeExecutionCallArgumentsParam] - """The arguments to pass to the code execution.""" + """Required. The arguments to pass to the code execution.""" type: Required[Literal["code_execution_call"]] diff --git a/google/genai/_interactions/types/code_execution_result_content.py b/google/genai/_interactions/types/code_execution_result_content.py index 21fda9505..526390542 100644 --- a/google/genai/_interactions/types/code_execution_result_content.py +++ b/google/genai/_interactions/types/code_execution_result_content.py @@ -30,7 +30,7 @@ class CodeExecutionResultContent(BaseModel): """ID to match the ID from the code execution call block.""" result: str - """The output of the code execution.""" + """Required. The output of the code execution.""" type: Literal["code_execution_result"] diff --git a/google/genai/_interactions/types/code_execution_result_content_param.py b/google/genai/_interactions/types/code_execution_result_content_param.py index cef894b4e..c7d83dba8 100644 --- a/google/genai/_interactions/types/code_execution_result_content_param.py +++ b/google/genai/_interactions/types/code_execution_result_content_param.py @@ -34,7 +34,7 @@ class CodeExecutionResultContentParam(TypedDict, total=False): """ID to match the ID from the code execution call block.""" result: Required[str] - """The output of the code execution.""" + """Required. The output of the code execution.""" type: Required[Literal["code_execution_result"]] diff --git a/google/genai/_interactions/types/content_delta.py b/google/genai/_interactions/types/content_delta.py index 11ecb0adb..3499815ee 100644 --- a/google/genai/_interactions/types/content_delta.py +++ b/google/genai/_interactions/types/content_delta.py @@ -327,9 +327,9 @@ class DeltaFileSearchResult(BaseModel): call_id: str """ID to match the ID from the function call block.""" - type: Literal["file_search_result"] + result: List[object] - result: Optional[List[object]] = None + type: Literal["file_search_result"] signature: Optional[str] = None """A signature hash for backend validation.""" @@ -339,11 +339,11 @@ class DeltaGoogleMapsResult(BaseModel): call_id: str """ID to match the ID from the function call block.""" - result: List[GoogleMapsResult] - """The results of the Google Maps.""" - type: Literal["google_maps_result"] + result: Optional[List[GoogleMapsResult]] = None + """The results of the Google Maps.""" + signature: Optional[str] = None """A signature hash for backend validation.""" diff --git a/google/genai/_interactions/types/file_search_result_content.py b/google/genai/_interactions/types/file_search_result_content.py index 31fa4d763..3b8e0660c 100644 --- a/google/genai/_interactions/types/file_search_result_content.py +++ b/google/genai/_interactions/types/file_search_result_content.py @@ -29,10 +29,10 @@ class FileSearchResultContent(BaseModel): call_id: str """ID to match the ID from the file search call block.""" - type: Literal["file_search_result"] + result: List[object] + """Required. The results of the File Search.""" - result: Optional[List[object]] = None - """The results of the File Search.""" + type: Literal["file_search_result"] signature: Optional[str] = None """A signature hash for backend validation.""" diff --git a/google/genai/_interactions/types/file_search_result_content_param.py b/google/genai/_interactions/types/file_search_result_content_param.py index fe04db52d..61c0736d0 100644 --- a/google/genai/_interactions/types/file_search_result_content_param.py +++ b/google/genai/_interactions/types/file_search_result_content_param.py @@ -33,10 +33,10 @@ class FileSearchResultContentParam(TypedDict, total=False): call_id: Required[str] """ID to match the ID from the file search call block.""" - type: Required[Literal["file_search_result"]] + result: Required[Iterable[object]] + """Required. The results of the File Search.""" - result: Iterable[object] - """The results of the File Search.""" + type: Required[Literal["file_search_result"]] signature: Annotated[Union[str, Base64FileInput], PropertyInfo(format="base64")] """A signature hash for backend validation.""" diff --git a/google/genai/_interactions/types/function_call_content.py b/google/genai/_interactions/types/function_call_content.py index b0e77d7e0..b19c887b3 100644 --- a/google/genai/_interactions/types/function_call_content.py +++ b/google/genai/_interactions/types/function_call_content.py @@ -30,10 +30,10 @@ class FunctionCallContent(BaseModel): """A unique ID for this specific tool call.""" arguments: Dict[str, object] - """The arguments to pass to the function.""" + """Required. The arguments to pass to the function.""" name: str - """The name of the tool to call.""" + """Required. The name of the tool to call.""" type: Literal["function_call"] diff --git a/google/genai/_interactions/types/function_call_content_param.py b/google/genai/_interactions/types/function_call_content_param.py index 032ea14e1..47a655143 100644 --- a/google/genai/_interactions/types/function_call_content_param.py +++ b/google/genai/_interactions/types/function_call_content_param.py @@ -34,10 +34,10 @@ class FunctionCallContentParam(TypedDict, total=False): """A unique ID for this specific tool call.""" arguments: Required[Dict[str, object]] - """The arguments to pass to the function.""" + """Required. The arguments to pass to the function.""" name: Required[str] - """The name of the tool to call.""" + """Required. The name of the tool to call.""" type: Required[Literal["function_call"]] diff --git a/google/genai/_interactions/types/google_maps_result_content.py b/google/genai/_interactions/types/google_maps_result_content.py index cafd72179..9c87fd7fb 100644 --- a/google/genai/_interactions/types/google_maps_result_content.py +++ b/google/genai/_interactions/types/google_maps_result_content.py @@ -31,7 +31,7 @@ class GoogleMapsResultContent(BaseModel): """ID to match the ID from the google maps call block.""" result: List[GoogleMapsResult] - """The results of the Google Maps.""" + """Required. The results of the Google Maps.""" type: Literal["google_maps_result"] diff --git a/google/genai/_interactions/types/google_maps_result_content_param.py b/google/genai/_interactions/types/google_maps_result_content_param.py index ffae22672..f600d7a68 100644 --- a/google/genai/_interactions/types/google_maps_result_content_param.py +++ b/google/genai/_interactions/types/google_maps_result_content_param.py @@ -35,7 +35,7 @@ class GoogleMapsResultContentParam(TypedDict, total=False): """ID to match the ID from the google maps call block.""" result: Required[Iterable[GoogleMapsResultParam]] - """The results of the Google Maps.""" + """Required. The results of the Google Maps.""" type: Required[Literal["google_maps_result"]] diff --git a/google/genai/_interactions/types/google_search_call_content.py b/google/genai/_interactions/types/google_search_call_content.py index bbda4edd0..e7f3a0be2 100644 --- a/google/genai/_interactions/types/google_search_call_content.py +++ b/google/genai/_interactions/types/google_search_call_content.py @@ -31,7 +31,7 @@ class GoogleSearchCallContent(BaseModel): """A unique ID for this specific tool call.""" arguments: GoogleSearchCallArguments - """The arguments to pass to Google Search.""" + """Required. The arguments to pass to Google Search.""" type: Literal["google_search_call"] diff --git a/google/genai/_interactions/types/google_search_call_content_param.py b/google/genai/_interactions/types/google_search_call_content_param.py index 3508a6eed..b8ca6bd23 100644 --- a/google/genai/_interactions/types/google_search_call_content_param.py +++ b/google/genai/_interactions/types/google_search_call_content_param.py @@ -35,7 +35,7 @@ class GoogleSearchCallContentParam(TypedDict, total=False): """A unique ID for this specific tool call.""" arguments: Required[GoogleSearchCallArgumentsParam] - """The arguments to pass to Google Search.""" + """Required. The arguments to pass to Google Search.""" type: Required[Literal["google_search_call"]] diff --git a/google/genai/_interactions/types/google_search_result_content.py b/google/genai/_interactions/types/google_search_result_content.py index 98777018c..e4769551e 100644 --- a/google/genai/_interactions/types/google_search_result_content.py +++ b/google/genai/_interactions/types/google_search_result_content.py @@ -31,7 +31,7 @@ class GoogleSearchResultContent(BaseModel): """ID to match the ID from the google search call block.""" result: List[GoogleSearchResult] - """The results of the Google Search.""" + """Required. The results of the Google Search.""" type: Literal["google_search_result"] diff --git a/google/genai/_interactions/types/google_search_result_content_param.py b/google/genai/_interactions/types/google_search_result_content_param.py index ac4cb4352..0557091d8 100644 --- a/google/genai/_interactions/types/google_search_result_content_param.py +++ b/google/genai/_interactions/types/google_search_result_content_param.py @@ -35,7 +35,7 @@ class GoogleSearchResultContentParam(TypedDict, total=False): """ID to match the ID from the google search call block.""" result: Required[Iterable[GoogleSearchResultParam]] - """The results of the Google Search.""" + """Required. The results of the Google Search.""" type: Required[Literal["google_search_result"]] diff --git a/google/genai/_interactions/types/interaction.py b/google/genai/_interactions/types/interaction.py index f0bbf9a0f..7db360680 100644 --- a/google/genai/_interactions/types/interaction.py +++ b/google/genai/_interactions/types/interaction.py @@ -86,22 +86,22 @@ class Interaction(BaseModel): """The Interaction resource.""" id: str - """Output only. A unique identifier for the interaction completion.""" + """Required. Output only. A unique identifier for the interaction completion.""" created: datetime - """Output only. + """Required. - The time at which the response was created in ISO 8601 format + Output only. The time at which the response was created in ISO 8601 format (YYYY-MM-DDThh:mm:ssZ). """ status: Literal["in_progress", "requires_action", "completed", "failed", "cancelled", "incomplete"] - """Output only. The status of the interaction.""" + """Required. Output only. The status of the interaction.""" updated: datetime - """Output only. + """Required. - The time at which the response was last updated in ISO 8601 format + Output only. The time at which the response was last updated in ISO 8601 format (YYYY-MM-DDThh:mm:ssZ). """ diff --git a/google/genai/_interactions/types/interaction_complete_event.py b/google/genai/_interactions/types/interaction_complete_event.py index 7b537a588..2b384a753 100644 --- a/google/genai/_interactions/types/interaction_complete_event.py +++ b/google/genai/_interactions/types/interaction_complete_event.py @@ -28,7 +28,8 @@ class InteractionCompleteEvent(BaseModel): event_type: Literal["interaction.complete"] interaction: Interaction - """ + """Required. + The completed interaction with empty outputs to reduce the payload size. Use the preceding ContentDelta events for the actual output. """ diff --git a/google/genai/_interactions/types/mcp_server_tool_call_content.py b/google/genai/_interactions/types/mcp_server_tool_call_content.py index c9c71858b..c647e2174 100644 --- a/google/genai/_interactions/types/mcp_server_tool_call_content.py +++ b/google/genai/_interactions/types/mcp_server_tool_call_content.py @@ -30,13 +30,13 @@ class MCPServerToolCallContent(BaseModel): """A unique ID for this specific tool call.""" arguments: Dict[str, object] - """The JSON object of arguments for the function.""" + """Required. The JSON object of arguments for the function.""" name: str - """The name of the tool which was called.""" + """Required. The name of the tool which was called.""" server_name: str - """The name of the used MCP server.""" + """Required. The name of the used MCP server.""" type: Literal["mcp_server_tool_call"] diff --git a/google/genai/_interactions/types/mcp_server_tool_call_content_param.py b/google/genai/_interactions/types/mcp_server_tool_call_content_param.py index 296c51396..821758f44 100644 --- a/google/genai/_interactions/types/mcp_server_tool_call_content_param.py +++ b/google/genai/_interactions/types/mcp_server_tool_call_content_param.py @@ -34,13 +34,13 @@ class MCPServerToolCallContentParam(TypedDict, total=False): """A unique ID for this specific tool call.""" arguments: Required[Dict[str, object]] - """The JSON object of arguments for the function.""" + """Required. The JSON object of arguments for the function.""" name: Required[str] - """The name of the tool which was called.""" + """Required. The name of the tool which was called.""" server_name: Required[str] - """The name of the used MCP server.""" + """Required. The name of the used MCP server.""" type: Required[Literal["mcp_server_tool_call"]] diff --git a/google/genai/_interactions/types/text_content.py b/google/genai/_interactions/types/text_content.py index d0b631f24..b753059e6 100644 --- a/google/genai/_interactions/types/text_content.py +++ b/google/genai/_interactions/types/text_content.py @@ -28,7 +28,7 @@ class TextContent(BaseModel): """A text content block.""" text: str - """The text content.""" + """Required. The text content.""" type: Literal["text"] diff --git a/google/genai/_interactions/types/text_content_param.py b/google/genai/_interactions/types/text_content_param.py index a9d5cfd7b..97eb9ebd7 100644 --- a/google/genai/_interactions/types/text_content_param.py +++ b/google/genai/_interactions/types/text_content_param.py @@ -29,7 +29,7 @@ class TextContentParam(TypedDict, total=False): """A text content block.""" text: Required[str] - """The text content.""" + """Required. The text content.""" type: Required[Literal["text"]] diff --git a/google/genai/_interactions/types/tool.py b/google/genai/_interactions/types/tool.py index 4e1d1a623..e7f2a1b92 100644 --- a/google/genai/_interactions/types/tool.py +++ b/google/genai/_interactions/types/tool.py @@ -109,6 +109,8 @@ class FileSearch(BaseModel): class GoogleMaps(BaseModel): """A tool that can be used by the model to call Google Maps.""" + type: Literal["google_maps"] + enable_widget: Optional[bool] = None """ Whether to return a widget context token in the tool call result of the @@ -121,8 +123,6 @@ class GoogleMaps(BaseModel): longitude: Optional[float] = None """The longitude of the user's location.""" - type: Optional[Literal["google_maps"]] = None - Tool: TypeAlias = Annotated[ Union[Function, CodeExecution, URLContext, ComputerUse, MCPServer, GoogleSearch, FileSearch, GoogleMaps], diff --git a/google/genai/_interactions/types/tool_param.py b/google/genai/_interactions/types/tool_param.py index 5a00955a8..c7d71c1bb 100644 --- a/google/genai/_interactions/types/tool_param.py +++ b/google/genai/_interactions/types/tool_param.py @@ -109,6 +109,8 @@ class FileSearch(TypedDict, total=False): class GoogleMaps(TypedDict, total=False): """A tool that can be used by the model to call Google Maps.""" + type: Required[Literal["google_maps"]] + enable_widget: bool """ Whether to return a widget context token in the tool call result of the @@ -121,8 +123,6 @@ class GoogleMaps(TypedDict, total=False): longitude: float """The longitude of the user's location.""" - type: Literal["google_maps"] - ToolParam: TypeAlias = Union[ FunctionParam, CodeExecution, URLContext, ComputerUse, MCPServer, GoogleSearch, FileSearch, GoogleMaps diff --git a/google/genai/_interactions/types/url_context_call_content.py b/google/genai/_interactions/types/url_context_call_content.py index 243f87ad2..36f1cfc58 100644 --- a/google/genai/_interactions/types/url_context_call_content.py +++ b/google/genai/_interactions/types/url_context_call_content.py @@ -31,7 +31,7 @@ class URLContextCallContent(BaseModel): """A unique ID for this specific tool call.""" arguments: URLContextCallArguments - """The arguments to pass to the URL context.""" + """Required. The arguments to pass to the URL context.""" type: Literal["url_context_call"] diff --git a/google/genai/_interactions/types/url_context_call_content_param.py b/google/genai/_interactions/types/url_context_call_content_param.py index e7ae71d4e..3650041ad 100644 --- a/google/genai/_interactions/types/url_context_call_content_param.py +++ b/google/genai/_interactions/types/url_context_call_content_param.py @@ -35,7 +35,7 @@ class URLContextCallContentParam(TypedDict, total=False): """A unique ID for this specific tool call.""" arguments: Required[URLContextCallArgumentsParam] - """The arguments to pass to the URL context.""" + """Required. The arguments to pass to the URL context.""" type: Required[Literal["url_context_call"]] diff --git a/google/genai/_interactions/types/url_context_result_content.py b/google/genai/_interactions/types/url_context_result_content.py index b4c9cbf5a..da9d86880 100644 --- a/google/genai/_interactions/types/url_context_result_content.py +++ b/google/genai/_interactions/types/url_context_result_content.py @@ -31,7 +31,7 @@ class URLContextResultContent(BaseModel): """ID to match the ID from the url context call block.""" result: List[URLContextResult] - """The results of the URL context.""" + """Required. The results of the URL context.""" type: Literal["url_context_result"] diff --git a/google/genai/_interactions/types/url_context_result_content_param.py b/google/genai/_interactions/types/url_context_result_content_param.py index a0c3ad36c..6c8efbfd9 100644 --- a/google/genai/_interactions/types/url_context_result_content_param.py +++ b/google/genai/_interactions/types/url_context_result_content_param.py @@ -35,7 +35,7 @@ class URLContextResultContentParam(TypedDict, total=False): """ID to match the ID from the url context call block.""" result: Required[Iterable[URLContextResultParam]] - """The results of the URL context.""" + """Required. The results of the URL context.""" type: Required[Literal["url_context_result"]]