diff --git a/google/genai/_interactions/types/__init__.py b/google/genai/_interactions/types/__init__.py index a98193110..9d912448a 100644 --- a/google/genai/_interactions/types/__init__.py +++ b/google/genai/_interactions/types/__init__.py @@ -29,7 +29,6 @@ from .error_event import ErrorEvent as ErrorEvent from .interaction import Interaction as Interaction from .model_param import ModelParam as ModelParam -from .tool_choice import ToolChoice as ToolChoice from .usage_param import UsageParam as UsageParam from .content_stop import ContentStop as ContentStop from .image_config import ImageConfig as ImageConfig @@ -52,7 +51,6 @@ from .document_content import DocumentContent as DocumentContent from .tool_choice_type import ToolChoiceType as ToolChoiceType from .generation_config import GenerationConfig as GenerationConfig -from .tool_choice_param import ToolChoiceParam as ToolChoiceParam from .document_mime_type import DocumentMimeType as DocumentMimeType from .image_config_param import ImageConfigParam as ImageConfigParam from .text_content_param import TextContentParam as TextContentParam diff --git a/google/genai/_interactions/types/generation_config.py b/google/genai/_interactions/types/generation_config.py index 06b5f39b4..4972faba0 100644 --- a/google/genai/_interactions/types/generation_config.py +++ b/google/genai/_interactions/types/generation_config.py @@ -15,16 +15,19 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional -from typing_extensions import Literal +from typing import List, Union, Optional +from typing_extensions import Literal, TypeAlias from .._models import BaseModel -from .tool_choice import ToolChoice from .image_config import ImageConfig from .speech_config import SpeechConfig from .thinking_level import ThinkingLevel +from .tool_choice_type import ToolChoiceType +from .tool_choice_config import ToolChoiceConfig -__all__ = ["GenerationConfig"] +__all__ = ["GenerationConfig", "ToolChoice"] + +ToolChoice: TypeAlias = Union[ToolChoiceType, ToolChoiceConfig] class GenerationConfig(BaseModel): diff --git a/google/genai/_interactions/types/generation_config_param.py b/google/genai/_interactions/types/generation_config_param.py index 58b145aef..a18ac8798 100644 --- a/google/genai/_interactions/types/generation_config_param.py +++ b/google/genai/_interactions/types/generation_config_param.py @@ -17,16 +17,19 @@ from __future__ import annotations -from typing import Iterable -from typing_extensions import Literal, TypedDict +from typing import Union, Iterable +from typing_extensions import Literal, TypeAlias, TypedDict from .._types import SequenceNotStr from .thinking_level import ThinkingLevel -from .tool_choice_param import ToolChoiceParam +from .tool_choice_type import ToolChoiceType from .image_config_param import ImageConfigParam from .speech_config_param import SpeechConfigParam +from .tool_choice_config_param import ToolChoiceConfigParam -__all__ = ["GenerationConfigParam"] +__all__ = ["GenerationConfigParam", "ToolChoice"] + +ToolChoice: TypeAlias = Union[ToolChoiceType, ToolChoiceConfigParam] class GenerationConfigParam(TypedDict, total=False): @@ -56,7 +59,7 @@ class GenerationConfigParam(TypedDict, total=False): thinking_summaries: Literal["auto", "none"] """Whether to include thought summaries in the response.""" - tool_choice: ToolChoiceParam + tool_choice: ToolChoice """The tool choice for the interaction.""" top_p: float diff --git a/google/genai/_interactions/types/tool_choice.py b/google/genai/_interactions/types/tool_choice.py deleted file mode 100644 index 1fc68efe2..000000000 --- a/google/genai/_interactions/types/tool_choice.py +++ /dev/null @@ -1,26 +0,0 @@ -# Copyright 2025 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. -# - -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union -from typing_extensions import TypeAlias - -from .tool_choice_type import ToolChoiceType -from .tool_choice_config import ToolChoiceConfig - -__all__ = ["ToolChoice"] - -ToolChoice: TypeAlias = Union[ToolChoiceType, ToolChoiceConfig] diff --git a/google/genai/_interactions/types/tool_choice_param.py b/google/genai/_interactions/types/tool_choice_param.py deleted file mode 100644 index 3cf39729c..000000000 --- a/google/genai/_interactions/types/tool_choice_param.py +++ /dev/null @@ -1,28 +0,0 @@ -# Copyright 2025 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. -# - -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union -from typing_extensions import TypeAlias - -from .tool_choice_type import ToolChoiceType -from .tool_choice_config_param import ToolChoiceConfigParam - -__all__ = ["ToolChoiceParam"] - -ToolChoiceParam: TypeAlias = Union[ToolChoiceType, ToolChoiceConfigParam]