Skip to content
Merged
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
2 changes: 2 additions & 0 deletions google/genai/_interactions/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 4 additions & 0 deletions google/genai/_interactions/types/generation_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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."""

Expand Down
4 changes: 4 additions & 0 deletions google/genai/_interactions/types/generation_config_param.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand All @@ -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."""

Expand Down
31 changes: 31 additions & 0 deletions google/genai/_interactions/types/image_config.py
Original file line number Diff line number Diff line change
@@ -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
30 changes: 30 additions & 0 deletions google/genai/_interactions/types/image_config_param.py
Original file line number Diff line number Diff line change
@@ -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"]