diff --git a/google/genai/_interactions/types/__init__.py b/google/genai/_interactions/types/__init__.py index d7692034d..bd448df72 100644 --- a/google/genai/_interactions/types/__init__.py +++ b/google/genai/_interactions/types/__init__.py @@ -32,6 +32,7 @@ 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 from .text_content import TextContent as TextContent from .allowed_tools import AllowedTools as AllowedTools from .audio_content import AudioContent as AudioContent @@ -54,6 +55,7 @@ from .interaction_event import InteractionEvent as InteractionEvent 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 from .tool_choice_config import ToolChoiceConfig as ToolChoiceConfig from .url_context_result import URLContextResult as URLContextResult diff --git a/google/genai/_interactions/types/generation_config.py b/google/genai/_interactions/types/generation_config.py index 81ef67b62..06b5f39b4 100644 --- a/google/genai/_interactions/types/generation_config.py +++ b/google/genai/_interactions/types/generation_config.py @@ -20,6 +20,7 @@ from .._models import BaseModel from .tool_choice import ToolChoice +from .image_config import ImageConfig from .speech_config import SpeechConfig from .thinking_level import ThinkingLevel @@ -29,6 +30,9 @@ class GenerationConfig(BaseModel): """Configuration parameters for model interactions.""" + image_config: Optional[ImageConfig] = None + """Configuration for image interaction.""" + max_output_tokens: Optional[int] = None """The maximum number of tokens to include in the response.""" diff --git a/google/genai/_interactions/types/generation_config_param.py b/google/genai/_interactions/types/generation_config_param.py index 0f84fbf36..58b145aef 100644 --- a/google/genai/_interactions/types/generation_config_param.py +++ b/google/genai/_interactions/types/generation_config_param.py @@ -23,6 +23,7 @@ from .._types import SequenceNotStr from .thinking_level import ThinkingLevel from .tool_choice_param import ToolChoiceParam +from .image_config_param import ImageConfigParam from .speech_config_param import SpeechConfigParam __all__ = ["GenerationConfigParam"] @@ -31,6 +32,9 @@ class GenerationConfigParam(TypedDict, total=False): """Configuration parameters for model interactions.""" + image_config: ImageConfigParam + """Configuration for image interaction.""" + max_output_tokens: int """The maximum number of tokens to include in the response.""" diff --git a/google/genai/_interactions/types/image_config.py b/google/genai/_interactions/types/image_config.py new file mode 100644 index 000000000..17c9e26a0 --- /dev/null +++ b/google/genai/_interactions/types/image_config.py @@ -0,0 +1,31 @@ +# 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 Optional +from typing_extensions import Literal + +from .._models import BaseModel + +__all__ = ["ImageConfig"] + + +class ImageConfig(BaseModel): + """The configuration for image interaction.""" + + aspect_ratio: Optional[Literal["1:1", "2:3", "3:2", "3:4", "4:3", "9:16", "16:9", "21:9"]] = None + + image_size: Optional[Literal["1K", "2K", "4K"]] = None diff --git a/google/genai/_interactions/types/image_config_param.py b/google/genai/_interactions/types/image_config_param.py new file mode 100644 index 000000000..23174556b --- /dev/null +++ b/google/genai/_interactions/types/image_config_param.py @@ -0,0 +1,30 @@ +# 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_extensions import Literal, TypedDict + +__all__ = ["ImageConfigParam"] + + +class ImageConfigParam(TypedDict, total=False): + """The configuration for image interaction.""" + + aspect_ratio: Literal["1:1", "2:3", "3:2", "3:4", "4:3", "9:16", "16:9", "21:9"] + + image_size: Literal["1K", "2K", "4K"]