diff --git a/google/genai/_gaos/resources/interactions/tool/__init__.py b/google/genai/_gaos/resources/interactions/tool/__init__.py index 4f63f2c5c..fd9decc4c 100644 --- a/google/genai/_gaos/resources/interactions/tool/__init__.py +++ b/google/genai/_gaos/resources/interactions/tool/__init__.py @@ -23,6 +23,7 @@ from ....types.interactions.googlesearch import GoogleSearch from ....types.interactions.mcpserver import MCPServer from ....types.interactions.retrieval import Retrieval +from ....types.interactions.toolsearch import ToolSearch from ....types.interactions.urlcontext import URLContext from . import retrieval @@ -34,6 +35,7 @@ "GoogleSearch", "MCPServer", "Retrieval", + "ToolSearch", "URLContext", "retrieval", ] diff --git a/google/genai/_gaos/types/interactions/__init__.py b/google/genai/_gaos/types/interactions/__init__.py index 011881a31..2ee8968bd 100644 --- a/google/genai/_gaos/types/interactions/__init__.py +++ b/google/genai/_gaos/types/interactions/__init__.py @@ -361,6 +361,7 @@ from .tool import Tool, ToolParam, UnknownTool from .toolchoiceconfig import ToolChoiceConfig, ToolChoiceConfigParam from .toolchoicetype import ToolChoiceType + from .toolsearch import ToolSearch, ToolSearchParam from .transcriptionconfig import TranscriptionConfig, TranscriptionConfigParam from .turn import Turn, TurnContent, TurnContentParam, TurnParam from .urlcitation import URLCitation, URLCitationParam @@ -709,6 +710,8 @@ "ToolChoiceParam", "ToolChoiceType", "ToolParam", + "ToolSearch", + "ToolSearchParam", "TranscriptionConfig", "TranscriptionConfigParam", "Transform", @@ -1092,6 +1095,8 @@ "ToolChoiceConfig": ".toolchoiceconfig", "ToolChoiceConfigParam": ".toolchoiceconfig", "ToolChoiceType": ".toolchoicetype", + "ToolSearch": ".toolsearch", + "ToolSearchParam": ".toolsearch", "TranscriptionConfig": ".transcriptionconfig", "TranscriptionConfigParam": ".transcriptionconfig", "Turn": ".turn", diff --git a/google/genai/_gaos/types/interactions/tool.py b/google/genai/_gaos/types/interactions/tool.py index edc5ffcd7..e13a82749 100644 --- a/google/genai/_gaos/types/interactions/tool.py +++ b/google/genai/_gaos/types/interactions/tool.py @@ -27,6 +27,7 @@ from .googlesearch import GoogleSearch, GoogleSearchParam from .mcpserver import MCPServer, MCPServerParam from .retrieval import Retrieval, RetrievalParam +from .toolsearch import ToolSearch, ToolSearchParam from .urlcontext import URLContext, URLContextParam from functools import partial from pydantic import ConfigDict @@ -40,6 +41,7 @@ Union[ CodeExecutionParam, URLContextParam, + ToolSearchParam, GoogleSearchParam, FunctionParam, FileSearchParam, @@ -72,6 +74,7 @@ class UnknownTool(BaseModel): "file_search": FileSearch, "google_maps": GoogleMaps, "retrieval": Retrieval, + "tool_search": ToolSearch, } @@ -86,6 +89,7 @@ class UnknownTool(BaseModel): FileSearch, GoogleMaps, Retrieval, + ToolSearch, UnknownTool, ], BeforeValidator( diff --git a/google/genai/_gaos/types/interactions/toolsearch.py b/google/genai/_gaos/types/interactions/toolsearch.py new file mode 100644 index 000000000..7ad0850c6 --- /dev/null +++ b/google/genai/_gaos/types/interactions/toolsearch.py @@ -0,0 +1,48 @@ +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# pyformat: disable + +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .. import BaseModel +from ...utils import validate_const +import pydantic +from pydantic.functional_validators import AfterValidator +from typing import Literal +from typing_extensions import Annotated, TypedDict + + +class ToolSearchParam(TypedDict): + r"""Tool search configuration.""" + + type: Literal["tool_search"] + + +class ToolSearch(BaseModel): + r"""Tool search configuration.""" + + type: Annotated[ + Annotated[ + Literal["tool_search"], AfterValidator(validate_const("tool_search")) + ], + pydantic.Field(alias="type"), + ] = "tool_search" + + +try: + ToolSearch.model_rebuild() +except NameError: + pass