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
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Original file line number Diff line number Diff line change
Expand Up @@ -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"]]
Original file line number Diff line number Diff line change
Expand Up @@ -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"]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"]]

Expand Down
99 changes: 91 additions & 8 deletions google/genai/_interactions/types/content.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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[
Expand All @@ -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"),
]
Loading
Loading