diff --git a/google/genai/_interactions/types/code_execution_call_content.py b/google/genai/_interactions/types/code_execution_call_content.py index 6d9c35ac9..519ee7989 100644 --- a/google/genai/_interactions/types/code_execution_call_content.py +++ b/google/genai/_interactions/types/code_execution_call_content.py @@ -30,6 +30,6 @@ 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 9e8bafa02..38c19848a 100644 --- a/google/genai/_interactions/types/code_execution_call_content_param.py +++ b/google/genai/_interactions/types/code_execution_call_content_param.py @@ -31,6 +31,6 @@ 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 c6d7ca31e..be6ccf1e4 100644 --- a/google/genai/_interactions/types/code_execution_result_content_param.py +++ b/google/genai/_interactions/types/code_execution_result_content_param.py @@ -29,7 +29,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.py b/google/genai/_interactions/types/content.py index 8a2dcc32a..1e7539db7 100644 --- a/google/genai/_interactions/types/content.py +++ b/google/genai/_interactions/types/content.py @@ -15,10 +15,11 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Union -from typing_extensions import Annotated, TypeAlias +from typing import List, Union, Optional +from typing_extensions import Literal, Annotated, TypeAlias from .._utils import PropertyInfo +from .._models import BaseModel from .text_content import TextContent from .audio_content import AudioContent from .image_content import ImageContent @@ -38,7 +39,87 @@ from .code_execution_result_content import CodeExecutionResultContent from .mcp_server_tool_result_content import MCPServerToolResultContent -__all__ = ["Content"] +__all__ = [ + "Content", + "GoogleMapsCall", + "GoogleMapsCallArguments", + "GoogleMapsResult", + "GoogleMapsResultResult", + "GoogleMapsResultResultReviewSnippet", +] + + +class GoogleMapsCallArguments(BaseModel): + """The arguments to pass to the Google Maps tool.""" + + queries: Optional[List[str]] = None + """The queries to be executed.""" + + +class GoogleMapsCall(BaseModel): + """Google Maps content.""" + + id: str + """Required. A unique ID for this specific tool call.""" + + type: Literal["google_maps_call"] + + arguments: Optional[GoogleMapsCallArguments] = None + """The arguments to pass to the Google Maps tool.""" + + +class GoogleMapsResultResultReviewSnippet(BaseModel): + """ + Encapsulates a snippet of a user review that answers a question about + the features of a specific place in Google Maps. + """ + + review_id: Optional[str] = None + """The ID of the review snippet.""" + + title: Optional[str] = None + """Title of the review.""" + + url: Optional[str] = None + """A link that corresponds to the user review on Google Maps.""" + + +class GoogleMapsResultResult(BaseModel): + """The result of the Google Maps.""" + + name: Optional[str] = None + """Title of the place.""" + + place_id: Optional[str] = None + """The ID of the place, in `places/{place_id}` format.""" + + review_snippets: Optional[List[GoogleMapsResultResultReviewSnippet]] = None + """ + Snippets of reviews that are used to generate answers about the + features of a given place in Google Maps. + """ + + url: Optional[str] = None + """URI reference of the place.""" + + +class GoogleMapsResult(BaseModel): + """Google Maps result content.""" + + call_id: str + """Required. ID to match the ID from the function call block.""" + + type: Literal["google_maps_result"] + + result: Optional[List[GoogleMapsResultResult]] = None + """The results of the Google Maps.""" + + signature: Optional[str] = None + """A signature hash for backend validation.""" + + widget_context_token: Optional[str] = None + """Resource name of the Google Maps widget context token.""" + Content: TypeAlias = Annotated[ Union[ @@ -49,17 +130,19 @@ VideoContent, ThoughtContent, FunctionCallContent, - FunctionResultContent, CodeExecutionCallContent, - CodeExecutionResultContent, URLContextCallContent, - URLContextResultContent, + MCPServerToolCallContent, GoogleSearchCallContent, + FileSearchCallContent, + GoogleMapsCall, + FunctionResultContent, + CodeExecutionResultContent, + URLContextResultContent, GoogleSearchResultContent, - MCPServerToolCallContent, MCPServerToolResultContent, - FileSearchCallContent, FileSearchResultContent, + GoogleMapsResult, ], PropertyInfo(discriminator="type"), ] diff --git a/google/genai/_interactions/types/content_delta.py b/google/genai/_interactions/types/content_delta.py index 94e298803..28415c5d3 100644 --- a/google/genai/_interactions/types/content_delta.py +++ b/google/genai/_interactions/types/content_delta.py @@ -41,24 +41,25 @@ "DeltaThoughtSummaryContent", "DeltaThoughtSignature", "DeltaFunctionCall", - "DeltaFunctionResult", - "DeltaFunctionResultResult", - "DeltaFunctionResultResultItems", - "DeltaFunctionResultResultItemsItem", "DeltaCodeExecutionCall", - "DeltaCodeExecutionResult", "DeltaURLContextCall", - "DeltaURLContextResult", "DeltaGoogleSearchCall", - "DeltaGoogleSearchResult", "DeltaMCPServerToolCall", - "DeltaMCPServerToolResult", - "DeltaMCPServerToolResultResult", - "DeltaMCPServerToolResultResultItems", - "DeltaMCPServerToolResultResultItemsItem", "DeltaFileSearchCall", + "DeltaGoogleMapsCall", + "DeltaGoogleMapsCallArguments", + "DeltaFunctionResult", + "DeltaFunctionResultResultFunctionResultSubcontentList", + "DeltaCodeExecutionResult", + "DeltaURLContextResult", + "DeltaGoogleSearchResult", + "DeltaMCPServerToolResult", + "DeltaMCPServerToolResultResultFunctionResultSubcontentList", "DeltaFileSearchResult", "DeltaFileSearchResultResult", + "DeltaGoogleMapsResult", + "DeltaGoogleMapsResultResult", + "DeltaGoogleMapsResultResultReviewSnippet", ] @@ -157,22 +158,83 @@ class DeltaFunctionCall(BaseModel): type: Literal["function_call"] -DeltaFunctionResultResultItemsItem: TypeAlias = Union[TextContent, ImageContent] +class DeltaCodeExecutionCall(BaseModel): + id: str + """A unique ID for this specific tool call.""" + + arguments: CodeExecutionCallArguments + """The arguments to pass to the code execution.""" + + type: Literal["code_execution_call"] + + +class DeltaURLContextCall(BaseModel): + id: str + """A unique ID for this specific tool call.""" + + arguments: URLContextCallArguments + """The arguments to pass to the URL context.""" + + type: Literal["url_context_call"] + + +class DeltaGoogleSearchCall(BaseModel): + id: str + """A unique ID for this specific tool call.""" + + arguments: GoogleSearchCallArguments + """The arguments to pass to Google Search.""" + + type: Literal["google_search_call"] + + +class DeltaMCPServerToolCall(BaseModel): + id: str + """A unique ID for this specific tool call.""" + + arguments: Dict[str, object] + + name: str + + server_name: str + + type: Literal["mcp_server_tool_call"] + + +class DeltaFileSearchCall(BaseModel): + id: str + """A unique ID for this specific tool call.""" + + type: Literal["file_search_call"] -class DeltaFunctionResultResultItems(BaseModel): - items: Optional[List[DeltaFunctionResultResultItemsItem]] = None +class DeltaGoogleMapsCallArguments(BaseModel): + """The arguments to pass to the Google Maps tool.""" + queries: Optional[List[str]] = None + """The queries to be executed.""" -DeltaFunctionResultResult: TypeAlias = Union[DeltaFunctionResultResultItems, str, object] + +class DeltaGoogleMapsCall(BaseModel): + id: str + """Required. A unique ID for this specific tool call.""" + + type: Literal["google_maps_call"] + + arguments: Optional[DeltaGoogleMapsCallArguments] = None + """The arguments to pass to the Google Maps tool.""" + + +DeltaFunctionResultResultFunctionResultSubcontentList: TypeAlias = Annotated[ + Union[TextContent, ImageContent], PropertyInfo(discriminator="type") +] class DeltaFunctionResult(BaseModel): call_id: str """ID to match the ID from the function call block.""" - result: DeltaFunctionResultResult - """Tool call result delta.""" + result: Union[List[DeltaFunctionResultResultFunctionResultSubcontentList], str, object] type: Literal["function_result"] @@ -184,16 +246,6 @@ class DeltaFunctionResult(BaseModel): """A signature hash for backend validation.""" -class DeltaCodeExecutionCall(BaseModel): - id: str - """A unique ID for this specific tool call.""" - - arguments: CodeExecutionCallArguments - """The arguments to pass to the code execution.""" - - type: Literal["code_execution_call"] - - class DeltaCodeExecutionResult(BaseModel): call_id: str """ID to match the ID from the function call block.""" @@ -208,16 +260,6 @@ class DeltaCodeExecutionResult(BaseModel): """A signature hash for backend validation.""" -class DeltaURLContextCall(BaseModel): - id: str - """A unique ID for this specific tool call.""" - - arguments: URLContextCallArguments - """The arguments to pass to the URL context.""" - - type: Literal["url_context_call"] - - class DeltaURLContextResult(BaseModel): call_id: str """ID to match the ID from the function call block.""" @@ -232,16 +274,6 @@ class DeltaURLContextResult(BaseModel): """A signature hash for backend validation.""" -class DeltaGoogleSearchCall(BaseModel): - id: str - """A unique ID for this specific tool call.""" - - arguments: GoogleSearchCallArguments - """The arguments to pass to Google Search.""" - - type: Literal["google_search_call"] - - class DeltaGoogleSearchResult(BaseModel): call_id: str """ID to match the ID from the function call block.""" @@ -256,35 +288,16 @@ class DeltaGoogleSearchResult(BaseModel): """A signature hash for backend validation.""" -class DeltaMCPServerToolCall(BaseModel): - id: str - """A unique ID for this specific tool call.""" - - arguments: Dict[str, object] - - name: str - - server_name: str - - type: Literal["mcp_server_tool_call"] - - -DeltaMCPServerToolResultResultItemsItem: TypeAlias = Union[TextContent, ImageContent] - - -class DeltaMCPServerToolResultResultItems(BaseModel): - items: Optional[List[DeltaMCPServerToolResultResultItemsItem]] = None - - -DeltaMCPServerToolResultResult: TypeAlias = Union[DeltaMCPServerToolResultResultItems, str, object] +DeltaMCPServerToolResultResultFunctionResultSubcontentList: TypeAlias = Annotated[ + Union[TextContent, ImageContent], PropertyInfo(discriminator="type") +] class DeltaMCPServerToolResult(BaseModel): call_id: str """ID to match the ID from the function call block.""" - result: DeltaMCPServerToolResultResult - """Tool call result delta.""" + result: Union[List[DeltaMCPServerToolResultResultFunctionResultSubcontentList], str, object] type: Literal["mcp_server_tool_result"] @@ -296,13 +309,6 @@ class DeltaMCPServerToolResult(BaseModel): """A signature hash for backend validation.""" -class DeltaFileSearchCall(BaseModel): - id: str - """A unique ID for this specific tool call.""" - - type: Literal["file_search_call"] - - class DeltaFileSearchResultResult(BaseModel): """The result of the File Search.""" @@ -320,13 +326,64 @@ class DeltaFileSearchResult(BaseModel): call_id: str """ID to match the ID from the function call block.""" + result: List[DeltaFileSearchResultResult] + type: Literal["file_search_result"] - result: Optional[List[DeltaFileSearchResultResult]] = None + signature: Optional[str] = None + """A signature hash for backend validation.""" + + +class DeltaGoogleMapsResultResultReviewSnippet(BaseModel): + """ + Encapsulates a snippet of a user review that answers a question about + the features of a specific place in Google Maps. + """ + + review_id: Optional[str] = None + """The ID of the review snippet.""" + + title: Optional[str] = None + """Title of the review.""" + + url: Optional[str] = None + """A link that corresponds to the user review on Google Maps.""" + + +class DeltaGoogleMapsResultResult(BaseModel): + """The result of the Google Maps.""" + + name: Optional[str] = None + """Title of the place.""" + + place_id: Optional[str] = None + """The ID of the place, in `places/{place_id}` format.""" + + review_snippets: Optional[List[DeltaGoogleMapsResultResultReviewSnippet]] = None + """ + Snippets of reviews that are used to generate answers about the + features of a given place in Google Maps. + """ + + url: Optional[str] = None + """URI reference of the place.""" + + +class DeltaGoogleMapsResult(BaseModel): + call_id: str + """Required. ID to match the ID from the function call block.""" + + type: Literal["google_maps_result"] + + result: Optional[List[DeltaGoogleMapsResultResult]] = None + """The results of the Google Maps.""" signature: Optional[str] = None """A signature hash for backend validation.""" + widget_context_token: Optional[str] = None + """Resource name of the Google Maps widget context token.""" + Delta: TypeAlias = Annotated[ Union[ @@ -338,17 +395,19 @@ class DeltaFileSearchResult(BaseModel): DeltaThoughtSummary, DeltaThoughtSignature, DeltaFunctionCall, - DeltaFunctionResult, DeltaCodeExecutionCall, - DeltaCodeExecutionResult, DeltaURLContextCall, - DeltaURLContextResult, DeltaGoogleSearchCall, - DeltaGoogleSearchResult, DeltaMCPServerToolCall, - DeltaMCPServerToolResult, DeltaFileSearchCall, + DeltaGoogleMapsCall, + DeltaFunctionResult, + DeltaCodeExecutionResult, + DeltaURLContextResult, + DeltaGoogleSearchResult, + DeltaMCPServerToolResult, DeltaFileSearchResult, + DeltaGoogleMapsResult, ], PropertyInfo(discriminator="type"), ] @@ -356,6 +415,7 @@ class DeltaFileSearchResult(BaseModel): class ContentDelta(BaseModel): delta: Delta + """The delta content data for a content block.""" event_type: Literal["content.delta"] @@ -363,5 +423,6 @@ class ContentDelta(BaseModel): event_id: Optional[str] = None """ - The event_id token to be used to resume the interaction stream, from this event. + The event_id token to be used to resume the interaction stream, from + this event. """ diff --git a/google/genai/_interactions/types/content_param.py b/google/genai/_interactions/types/content_param.py index c1970fe16..890919c55 100644 --- a/google/genai/_interactions/types/content_param.py +++ b/google/genai/_interactions/types/content_param.py @@ -17,9 +17,10 @@ from __future__ import annotations -from typing import Union -from typing_extensions import TypeAlias +from typing import Union, Iterable +from typing_extensions import Literal, Required, TypeAlias, TypedDict +from .._types import SequenceNotStr from .text_content_param import TextContentParam from .audio_content_param import AudioContentParam from .image_content_param import ImageContentParam @@ -39,7 +40,87 @@ from .code_execution_result_content_param import CodeExecutionResultContentParam from .mcp_server_tool_result_content_param import MCPServerToolResultContentParam -__all__ = ["ContentParam"] +__all__ = [ + "ContentParam", + "GoogleMapsCall", + "GoogleMapsCallArguments", + "GoogleMapsResult", + "GoogleMapsResultResult", + "GoogleMapsResultResultReviewSnippet", +] + + +class GoogleMapsCallArguments(TypedDict, total=False): + """The arguments to pass to the Google Maps tool.""" + + queries: SequenceNotStr[str] + """The queries to be executed.""" + + +class GoogleMapsCall(TypedDict, total=False): + """Google Maps content.""" + + id: Required[str] + """Required. A unique ID for this specific tool call.""" + + type: Required[Literal["google_maps_call"]] + + arguments: GoogleMapsCallArguments + """The arguments to pass to the Google Maps tool.""" + + +class GoogleMapsResultResultReviewSnippet(TypedDict, total=False): + """ + Encapsulates a snippet of a user review that answers a question about + the features of a specific place in Google Maps. + """ + + review_id: str + """The ID of the review snippet.""" + + title: str + """Title of the review.""" + + url: str + """A link that corresponds to the user review on Google Maps.""" + + +class GoogleMapsResultResult(TypedDict, total=False): + """The result of the Google Maps.""" + + name: str + """Title of the place.""" + + place_id: str + """The ID of the place, in `places/{place_id}` format.""" + + review_snippets: Iterable[GoogleMapsResultResultReviewSnippet] + """ + Snippets of reviews that are used to generate answers about the + features of a given place in Google Maps. + """ + + url: str + """URI reference of the place.""" + + +class GoogleMapsResult(TypedDict, total=False): + """Google Maps result content.""" + + call_id: Required[str] + """Required. ID to match the ID from the function call block.""" + + type: Required[Literal["google_maps_result"]] + + result: Iterable[GoogleMapsResultResult] + """The results of the Google Maps.""" + + signature: str + """A signature hash for backend validation.""" + + widget_context_token: str + """Resource name of the Google Maps widget context token.""" + ContentParam: TypeAlias = Union[ TextContentParam, @@ -49,15 +130,17 @@ VideoContentParam, ThoughtContentParam, FunctionCallContentParam, - FunctionResultContentParam, CodeExecutionCallContentParam, - CodeExecutionResultContentParam, URLContextCallContentParam, - URLContextResultContentParam, + MCPServerToolCallContentParam, GoogleSearchCallContentParam, + FileSearchCallContentParam, + GoogleMapsCall, + FunctionResultContentParam, + CodeExecutionResultContentParam, + URLContextResultContentParam, GoogleSearchResultContentParam, - MCPServerToolCallContentParam, MCPServerToolResultContentParam, - FileSearchCallContentParam, FileSearchResultContentParam, + GoogleMapsResult, ] diff --git a/google/genai/_interactions/types/content_start.py b/google/genai/_interactions/types/content_start.py index 1431cb1eb..31688b7bd 100644 --- a/google/genai/_interactions/types/content_start.py +++ b/google/genai/_interactions/types/content_start.py @@ -34,5 +34,6 @@ class ContentStart(BaseModel): event_id: Optional[str] = None """ - The event_id token to be used to resume the interaction stream, from this event. + The event_id token to be used to resume the interaction stream, from + this event. """ diff --git a/google/genai/_interactions/types/content_stop.py b/google/genai/_interactions/types/content_stop.py index 578c1f2c9..d564cb7ec 100644 --- a/google/genai/_interactions/types/content_stop.py +++ b/google/genai/_interactions/types/content_stop.py @@ -30,5 +30,6 @@ class ContentStop(BaseModel): event_id: Optional[str] = None """ - The event_id token to be used to resume the interaction stream, from this event. + The event_id token to be used to resume the interaction stream, from + this event. """ diff --git a/google/genai/_interactions/types/error_event.py b/google/genai/_interactions/types/error_event.py index 8abf8ca3e..e109de7f6 100644 --- a/google/genai/_interactions/types/error_event.py +++ b/google/genai/_interactions/types/error_event.py @@ -41,5 +41,6 @@ class ErrorEvent(BaseModel): event_id: Optional[str] = None """ - The event_id token to be used to resume the interaction stream, from this event. + The event_id token to be used to resume the interaction stream, from + this event. """ diff --git a/google/genai/_interactions/types/file_search_result_content.py b/google/genai/_interactions/types/file_search_result_content.py index be786f037..fce5cfd7f 100644 --- a/google/genai/_interactions/types/file_search_result_content.py +++ b/google/genai/_interactions/types/file_search_result_content.py @@ -42,10 +42,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[Result] + """Required. The results of the File Search.""" - result: Optional[List[Result]] = 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 a891c0174..d78c7030c 100644 --- a/google/genai/_interactions/types/file_search_result_content_param.py +++ b/google/genai/_interactions/types/file_search_result_content_param.py @@ -42,10 +42,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[Result]] + """Required. The results of the File Search.""" - result: Iterable[Result] - """The results of the File Search.""" + type: Required[Literal["file_search_result"]] signature: str """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 a6c0aeba2..f74de745e 100644 --- a/google/genai/_interactions/types/function_call_content.py +++ b/google/genai/_interactions/types/function_call_content.py @@ -30,9 +30,9 @@ 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 d32d4e29e..3b534c991 100644 --- a/google/genai/_interactions/types/function_call_content_param.py +++ b/google/genai/_interactions/types/function_call_content_param.py @@ -30,9 +30,9 @@ 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/generation_config.py b/google/genai/_interactions/types/generation_config.py index 4972faba0..cf2b99c9a 100644 --- a/google/genai/_interactions/types/generation_config.py +++ b/google/genai/_interactions/types/generation_config.py @@ -58,7 +58,7 @@ class GenerationConfig(BaseModel): """Whether to include thought summaries in the response.""" tool_choice: Optional[ToolChoice] = None - """The tool choice for the interaction.""" + """The tool choice configuration.""" top_p: Optional[float] = None """The maximum cumulative probability of tokens to consider when sampling.""" diff --git a/google/genai/_interactions/types/generation_config_param.py b/google/genai/_interactions/types/generation_config_param.py index a18ac8798..286df7766 100644 --- a/google/genai/_interactions/types/generation_config_param.py +++ b/google/genai/_interactions/types/generation_config_param.py @@ -60,7 +60,7 @@ class GenerationConfigParam(TypedDict, total=False): """Whether to include thought summaries in the response.""" tool_choice: ToolChoice - """The tool choice for the interaction.""" + """The tool choice configuration.""" top_p: float """The maximum cumulative probability of tokens to consider when sampling.""" diff --git a/google/genai/_interactions/types/google_search_call_content.py b/google/genai/_interactions/types/google_search_call_content.py index fa16e6318..bed5d578c 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 f8ac6ee54..8a3259b58 100644 --- a/google/genai/_interactions/types/google_search_call_content_param.py +++ b/google/genai/_interactions/types/google_search_call_content_param.py @@ -31,7 +31,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 67fe65e0a..ccc8c1a23 100644 --- a/google/genai/_interactions/types/google_search_result_content_param.py +++ b/google/genai/_interactions/types/google_search_result_content_param.py @@ -32,7 +32,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 4a35a07dd..821f7f4be 100644 --- a/google/genai/_interactions/types/interaction.py +++ b/google/genai/_interactions/types/interaction.py @@ -47,12 +47,94 @@ from .code_execution_result_content import CodeExecutionResultContent from .mcp_server_tool_result_content import MCPServerToolResultContent -__all__ = ["Interaction", "AgentConfig", "Input"] +__all__ = [ + "Interaction", + "AgentConfig", + "Input", + "InputGoogleMapsCallContent", + "InputGoogleMapsCallContentArguments", + "InputGoogleMapsResultContent", + "InputGoogleMapsResultContentResult", + "InputGoogleMapsResultContentResultReviewSnippet", +] AgentConfig: TypeAlias = Annotated[ Union[DynamicAgentConfig, DeepResearchAgentConfig], PropertyInfo(discriminator="type") ] + +class InputGoogleMapsCallContentArguments(BaseModel): + """The arguments to pass to the Google Maps tool.""" + + queries: Optional[List[str]] = None + """The queries to be executed.""" + + +class InputGoogleMapsCallContent(BaseModel): + """Google Maps content.""" + + id: str + """Required. A unique ID for this specific tool call.""" + + type: Literal["google_maps_call"] + + arguments: Optional[InputGoogleMapsCallContentArguments] = None + """The arguments to pass to the Google Maps tool.""" + + +class InputGoogleMapsResultContentResultReviewSnippet(BaseModel): + """ + Encapsulates a snippet of a user review that answers a question about + the features of a specific place in Google Maps. + """ + + review_id: Optional[str] = None + """The ID of the review snippet.""" + + title: Optional[str] = None + """Title of the review.""" + + url: Optional[str] = None + """A link that corresponds to the user review on Google Maps.""" + + +class InputGoogleMapsResultContentResult(BaseModel): + """The result of the Google Maps.""" + + name: Optional[str] = None + """Title of the place.""" + + place_id: Optional[str] = None + """The ID of the place, in `places/{place_id}` format.""" + + review_snippets: Optional[List[InputGoogleMapsResultContentResultReviewSnippet]] = None + """ + Snippets of reviews that are used to generate answers about the + features of a given place in Google Maps. + """ + + url: Optional[str] = None + """URI reference of the place.""" + + +class InputGoogleMapsResultContent(BaseModel): + """Google Maps result content.""" + + call_id: str + """Required. ID to match the ID from the function call block.""" + + type: Literal["google_maps_result"] + + result: Optional[List[InputGoogleMapsResultContentResult]] = None + """The results of the Google Maps.""" + + signature: Optional[str] = None + """A signature hash for backend validation.""" + + widget_context_token: Optional[str] = None + """Resource name of the Google Maps widget context token.""" + + Input: TypeAlias = Union[ List[Content], str, @@ -64,17 +146,19 @@ VideoContent, ThoughtContent, FunctionCallContent, - FunctionResultContent, CodeExecutionCallContent, - CodeExecutionResultContent, URLContextCallContent, - URLContextResultContent, + MCPServerToolCallContent, GoogleSearchCallContent, + FileSearchCallContent, + InputGoogleMapsCallContent, + FunctionResultContent, + CodeExecutionResultContent, + URLContextResultContent, GoogleSearchResultContent, - MCPServerToolCallContent, MCPServerToolResultContent, - FileSearchCallContent, FileSearchResultContent, + InputGoogleMapsResultContent, ] @@ -82,22 +166,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 b45a642f5..2b384a753 100644 --- a/google/genai/_interactions/types/interaction_complete_event.py +++ b/google/genai/_interactions/types/interaction_complete_event.py @@ -28,12 +28,14 @@ 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. """ event_id: Optional[str] = None """ - The event_id token to be used to resume the interaction stream, from this event. + The event_id token to be used to resume the interaction stream, from + this event. """ diff --git a/google/genai/_interactions/types/interaction_create_params.py b/google/genai/_interactions/types/interaction_create_params.py index beeede433..862852149 100644 --- a/google/genai/_interactions/types/interaction_create_params.py +++ b/google/genai/_interactions/types/interaction_create_params.py @@ -20,6 +20,7 @@ from typing import List, Union, Iterable from typing_extensions import Literal, Required, TypeAlias, TypedDict +from .._types import SequenceNotStr from .tool_param import ToolParam from .turn_param import TurnParam from .model_param import ModelParam @@ -49,6 +50,11 @@ __all__ = [ "BaseCreateModelInteractionParams", "Input", + "GoogleMapsCallContent", + "GoogleMapsCallContentArguments", + "GoogleMapsResultContent", + "GoogleMapsResultContentResult", + "GoogleMapsResultContentResultReviewSnippet", "BaseCreateAgentInteractionParams", "AgentConfig", "CreateModelInteractionParamsNonStreaming", @@ -98,6 +104,78 @@ class BaseCreateModelInteractionParams(TypedDict, total=False): """A list of tool declarations the model may call during interaction.""" +class GoogleMapsCallContentArguments(TypedDict, total=False): + """The arguments to pass to the Google Maps tool.""" + + queries: SequenceNotStr[str] + """The queries to be executed.""" + + +class GoogleMapsCallContent(TypedDict, total=False): + """Google Maps content.""" + + id: Required[str] + """Required. A unique ID for this specific tool call.""" + + type: Required[Literal["google_maps_call"]] + + arguments: GoogleMapsCallContentArguments + """The arguments to pass to the Google Maps tool.""" + + +class GoogleMapsResultContentResultReviewSnippet(TypedDict, total=False): + """ + Encapsulates a snippet of a user review that answers a question about + the features of a specific place in Google Maps. + """ + + review_id: str + """The ID of the review snippet.""" + + title: str + """Title of the review.""" + + url: str + """A link that corresponds to the user review on Google Maps.""" + + +class GoogleMapsResultContentResult(TypedDict, total=False): + """The result of the Google Maps.""" + + name: str + """Title of the place.""" + + place_id: str + """The ID of the place, in `places/{place_id}` format.""" + + review_snippets: Iterable[GoogleMapsResultContentResultReviewSnippet] + """ + Snippets of reviews that are used to generate answers about the + features of a given place in Google Maps. + """ + + url: str + """URI reference of the place.""" + + +class GoogleMapsResultContent(TypedDict, total=False): + """Google Maps result content.""" + + call_id: Required[str] + """Required. ID to match the ID from the function call block.""" + + type: Required[Literal["google_maps_result"]] + + result: Iterable[GoogleMapsResultContentResult] + """The results of the Google Maps.""" + + signature: str + """A signature hash for backend validation.""" + + widget_context_token: str + """Resource name of the Google Maps widget context token.""" + + Input: TypeAlias = Union[ Iterable[ContentParam], str, @@ -109,17 +187,19 @@ class BaseCreateModelInteractionParams(TypedDict, total=False): VideoContentParam, ThoughtContentParam, FunctionCallContentParam, - FunctionResultContentParam, CodeExecutionCallContentParam, - CodeExecutionResultContentParam, URLContextCallContentParam, - URLContextResultContentParam, + MCPServerToolCallContentParam, GoogleSearchCallContentParam, + FileSearchCallContentParam, + GoogleMapsCallContent, + FunctionResultContentParam, + CodeExecutionResultContentParam, + URLContextResultContentParam, GoogleSearchResultContentParam, - MCPServerToolCallContentParam, MCPServerToolResultContentParam, - FileSearchCallContentParam, FileSearchResultContentParam, + GoogleMapsResultContent, ] diff --git a/google/genai/_interactions/types/interaction_start_event.py b/google/genai/_interactions/types/interaction_start_event.py index 1202ec849..6bca76557 100644 --- a/google/genai/_interactions/types/interaction_start_event.py +++ b/google/genai/_interactions/types/interaction_start_event.py @@ -32,5 +32,6 @@ class InteractionStartEvent(BaseModel): event_id: Optional[str] = None """ - The event_id token to be used to resume the interaction stream, from this event. + The event_id token to be used to resume the interaction stream, from + this event. """ diff --git a/google/genai/_interactions/types/interaction_status_update.py b/google/genai/_interactions/types/interaction_status_update.py index b4c571ab3..aca983c58 100644 --- a/google/genai/_interactions/types/interaction_status_update.py +++ b/google/genai/_interactions/types/interaction_status_update.py @@ -32,5 +32,6 @@ class InteractionStatusUpdate(BaseModel): event_id: Optional[str] = None """ - The event_id token to be used to resume the interaction stream, from this event. + The event_id token to be used to resume the interaction stream, from + this event. """ 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 af5eff8e4..861150ceb 100644 --- a/google/genai/_interactions/types/mcp_server_tool_call_content.py +++ b/google/genai/_interactions/types/mcp_server_tool_call_content.py @@ -30,12 +30,12 @@ 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 f9d444230..00f448d7e 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 @@ -30,12 +30,12 @@ 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 6c70302f7..e7f2a1b92 100644 --- a/google/genai/_interactions/types/tool.py +++ b/google/genai/_interactions/types/tool.py @@ -25,7 +25,16 @@ from .function import Function from .allowed_tools import AllowedTools -__all__ = ["Tool", "CodeExecution", "URLContext", "ComputerUse", "MCPServer", "GoogleSearch", "FileSearch"] +__all__ = [ + "Tool", + "CodeExecution", + "URLContext", + "ComputerUse", + "MCPServer", + "GoogleSearch", + "FileSearch", + "GoogleMaps", +] class CodeExecution(BaseModel): @@ -97,7 +106,25 @@ class FileSearch(BaseModel): """The number of semantic retrieval chunks to retrieve.""" +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 + response. + """ + + latitude: Optional[float] = None + """The latitude of the user's location.""" + + longitude: Optional[float] = None + """The longitude of the user's location.""" + + Tool: TypeAlias = Annotated[ - Union[Function, CodeExecution, URLContext, ComputerUse, MCPServer, GoogleSearch, FileSearch], + Union[Function, CodeExecution, URLContext, ComputerUse, MCPServer, GoogleSearch, FileSearch, GoogleMaps], PropertyInfo(discriminator="type"), ] diff --git a/google/genai/_interactions/types/tool_param.py b/google/genai/_interactions/types/tool_param.py index e408e7acf..c7d71c1bb 100644 --- a/google/genai/_interactions/types/tool_param.py +++ b/google/genai/_interactions/types/tool_param.py @@ -25,7 +25,16 @@ from .function_param import FunctionParam from .allowed_tools_param import AllowedToolsParam -__all__ = ["ToolParam", "CodeExecution", "URLContext", "ComputerUse", "MCPServer", "GoogleSearch", "FileSearch"] +__all__ = [ + "ToolParam", + "CodeExecution", + "URLContext", + "ComputerUse", + "MCPServer", + "GoogleSearch", + "FileSearch", + "GoogleMaps", +] class CodeExecution(TypedDict, total=False): @@ -97,4 +106,24 @@ class FileSearch(TypedDict, total=False): """The number of semantic retrieval chunks to retrieve.""" -ToolParam: TypeAlias = Union[FunctionParam, CodeExecution, URLContext, ComputerUse, MCPServer, GoogleSearch, FileSearch] +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 + response. + """ + + latitude: float + """The latitude of the user's location.""" + + longitude: float + """The longitude of the user's location.""" + + +ToolParam: TypeAlias = Union[ + FunctionParam, CodeExecution, URLContext, ComputerUse, MCPServer, GoogleSearch, FileSearch, GoogleMaps +] diff --git a/google/genai/_interactions/types/turn.py b/google/genai/_interactions/types/turn.py index b769c7686..b7be1b25f 100644 --- a/google/genai/_interactions/types/turn.py +++ b/google/genai/_interactions/types/turn.py @@ -24,8 +24,7 @@ class Turn(BaseModel): - content: Union[str, List[Content], None] = None - """The content of the turn.""" + content: Union[List[Content], str, None] = None role: Optional[str] = None """The originator of this turn. diff --git a/google/genai/_interactions/types/turn_param.py b/google/genai/_interactions/types/turn_param.py index e55030db1..975b7f1ec 100644 --- a/google/genai/_interactions/types/turn_param.py +++ b/google/genai/_interactions/types/turn_param.py @@ -26,8 +26,7 @@ class TurnParam(TypedDict, total=False): - content: Union[str, Iterable[ContentParam]] - """The content of the turn.""" + content: Union[Iterable[ContentParam], str] role: str """The originator of this turn. diff --git a/google/genai/_interactions/types/url_context_call_content.py b/google/genai/_interactions/types/url_context_call_content.py index 6e09535ef..b7352e698 100644 --- a/google/genai/_interactions/types/url_context_call_content.py +++ b/google/genai/_interactions/types/url_context_call_content.py @@ -30,6 +30,6 @@ 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 628a3b31e..b317d5936 100644 --- a/google/genai/_interactions/types/url_context_call_content_param.py +++ b/google/genai/_interactions/types/url_context_call_content_param.py @@ -31,6 +31,6 @@ 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 558f42581..387e6bec6 100644 --- a/google/genai/_interactions/types/url_context_result_content_param.py +++ b/google/genai/_interactions/types/url_context_result_content_param.py @@ -32,7 +32,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"]]