diff --git a/google/genai/_interactions/types/content_delta.py b/google/genai/_interactions/types/content_delta.py index 415aef316..d38b84e29 100644 --- a/google/genai/_interactions/types/content_delta.py +++ b/google/genai/_interactions/types/content_delta.py @@ -57,7 +57,6 @@ "DeltaMCPServerToolResult", "DeltaMCPServerToolResultResultFunctionResultSubcontentList", "DeltaFileSearchResult", - "DeltaFileSearchResultResult", "DeltaGoogleMapsResult", "DeltaTextAnnotation", ] @@ -345,18 +344,11 @@ class DeltaMCPServerToolResult(BaseModel): """A signature hash for backend validation.""" -class DeltaFileSearchResultResult(BaseModel): - """The result of the File Search.""" - - custom_metadata: Optional[List[object]] = None - """User provided metadata about the FileSearchResult.""" - - class DeltaFileSearchResult(BaseModel): call_id: str """Required. ID to match the ID from the function call block.""" - result: List[DeltaFileSearchResultResult] + result: List[object] type: Literal["file_search_result"] diff --git a/google/genai/_interactions/types/file_citation.py b/google/genai/_interactions/types/file_citation.py index d6f760505..5c06b04ca 100644 --- a/google/genai/_interactions/types/file_citation.py +++ b/google/genai/_interactions/types/file_citation.py @@ -15,7 +15,7 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional +from typing import Dict, Optional from typing_extensions import Literal from .._models import BaseModel @@ -28,6 +28,9 @@ class FileCitation(BaseModel): type: Literal["file_citation"] + custom_metadata: Optional[Dict[str, object]] = None + """User provided metadata about the retrieved context.""" + document_uri: Optional[str] = None """The URI of the file.""" @@ -37,6 +40,12 @@ class FileCitation(BaseModel): file_name: Optional[str] = None """The name of the file.""" + media_id: Optional[str] = None + """Media ID in-case of image citations, if applicable.""" + + page_number: Optional[int] = None + """Page number of the cited document, if applicable.""" + source: Optional[str] = None """Source attributed for a portion of the text.""" diff --git a/google/genai/_interactions/types/file_citation_param.py b/google/genai/_interactions/types/file_citation_param.py index e7ccff934..2f4b5667d 100644 --- a/google/genai/_interactions/types/file_citation_param.py +++ b/google/genai/_interactions/types/file_citation_param.py @@ -17,6 +17,7 @@ from __future__ import annotations +from typing import Dict from typing_extensions import Literal, Required, TypedDict __all__ = ["FileCitationParam"] @@ -27,6 +28,9 @@ class FileCitationParam(TypedDict, total=False): type: Required[Literal["file_citation"]] + custom_metadata: Dict[str, object] + """User provided metadata about the retrieved context.""" + document_uri: str """The URI of the file.""" @@ -36,6 +40,12 @@ class FileCitationParam(TypedDict, total=False): file_name: str """The name of the file.""" + media_id: str + """Media ID in-case of image citations, if applicable.""" + + page_number: int + """Page number of the cited document, if applicable.""" + source: str """Source attributed for a portion of the text.""" diff --git a/google/genai/_interactions/types/file_search_result_content.py b/google/genai/_interactions/types/file_search_result_content.py index 84644074d..63ea02310 100644 --- a/google/genai/_interactions/types/file_search_result_content.py +++ b/google/genai/_interactions/types/file_search_result_content.py @@ -20,14 +20,7 @@ from .._models import BaseModel -__all__ = ["FileSearchResultContent", "Result"] - - -class Result(BaseModel): - """The result of the File Search.""" - - custom_metadata: Optional[List[object]] = None - """User provided metadata about the FileSearchResult.""" +__all__ = ["FileSearchResultContent"] class FileSearchResultContent(BaseModel): @@ -36,10 +29,10 @@ class FileSearchResultContent(BaseModel): call_id: str """Required. ID to match the ID from the function call block.""" - result: List[Result] - """Required. The results of the File Search.""" - type: Literal["file_search_result"] + result: Optional[List[object]] = None + """Optional. The results of the File Search.""" + 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 16ddc80a6..db129e731 100644 --- a/google/genai/_interactions/types/file_search_result_content_param.py +++ b/google/genai/_interactions/types/file_search_result_content_param.py @@ -24,14 +24,7 @@ from .._utils import PropertyInfo from .._models import set_pydantic_config -__all__ = ["FileSearchResultContentParam", "Result"] - - -class Result(TypedDict, total=False): - """The result of the File Search.""" - - custom_metadata: Iterable[object] - """User provided metadata about the FileSearchResult.""" +__all__ = ["FileSearchResultContentParam"] class FileSearchResultContentParam(TypedDict, total=False): @@ -40,11 +33,11 @@ class FileSearchResultContentParam(TypedDict, total=False): call_id: Required[str] """Required. ID to match the ID from the function call block.""" - result: Required[Iterable[Result]] - """Required. The results of the File Search.""" - type: Required[Literal["file_search_result"]] + result: Iterable[object] + """Optional. The results of the File Search.""" + signature: Annotated[Union[str, Base64FileInput], PropertyInfo(format="base64")] """A signature hash for backend validation.""" diff --git a/google/genai/_interactions/types/usage.py b/google/genai/_interactions/types/usage.py index 61cf506a6..7530f04f0 100644 --- a/google/genai/_interactions/types/usage.py +++ b/google/genai/_interactions/types/usage.py @@ -23,6 +23,7 @@ __all__ = [ "Usage", "CachedTokensByModality", + "GroundingToolCount", "InputTokensByModality", "OutputTokensByModality", "ToolUseTokensByModality", @@ -39,6 +40,16 @@ class CachedTokensByModality(BaseModel): """Number of tokens for the modality.""" +class GroundingToolCount(BaseModel): + """The number of calls by a single tool category.""" + + count: Optional[int] = None + """The number of grounding tool counts.""" + + type: Optional[Literal["google_search", "google_map", "your_data"]] = None + """The grounding tool type associated with the count.""" + + class InputTokensByModality(BaseModel): """The token count for a single response modality.""" @@ -75,6 +86,9 @@ class Usage(BaseModel): cached_tokens_by_modality: Optional[List[CachedTokensByModality]] = None """A breakdown of cached token usage by modality.""" + grounding_tool_count: Optional[List[GroundingToolCount]] = None + """Grounding tool count.""" + input_tokens_by_modality: Optional[List[InputTokensByModality]] = None """A breakdown of input token usage by modality.""" diff --git a/google/genai/_interactions/types/usage_param.py b/google/genai/_interactions/types/usage_param.py index b2806aae5..9fa31aae1 100644 --- a/google/genai/_interactions/types/usage_param.py +++ b/google/genai/_interactions/types/usage_param.py @@ -23,6 +23,7 @@ __all__ = [ "UsageParam", "CachedTokensByModality", + "GroundingToolCount", "InputTokensByModality", "OutputTokensByModality", "ToolUseTokensByModality", @@ -39,6 +40,16 @@ class CachedTokensByModality(TypedDict, total=False): """Number of tokens for the modality.""" +class GroundingToolCount(TypedDict, total=False): + """The number of calls by a single tool category.""" + + count: int + """The number of grounding tool counts.""" + + type: Literal["google_search", "google_map", "your_data"] + """The grounding tool type associated with the count.""" + + class InputTokensByModality(TypedDict, total=False): """The token count for a single response modality.""" @@ -75,6 +86,9 @@ class UsageParam(TypedDict, total=False): cached_tokens_by_modality: Iterable[CachedTokensByModality] """A breakdown of cached token usage by modality.""" + grounding_tool_count: Iterable[GroundingToolCount] + """Grounding tool count.""" + input_tokens_by_modality: Iterable[InputTokensByModality] """A breakdown of input token usage by modality."""