Skip to content

Commit 8b2a4e0

Browse files
Annhiluccopybara-github
authored andcommitted
feat: Support more image sizes and resolutions
PiperOrigin-RevId: 875269060
1 parent b28d144 commit 8b2a4e0

6 files changed

Lines changed: 22 additions & 5 deletions

File tree

google/genai/_interactions/types/google_search_call_content.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
1717

18+
from typing import Optional
1819
from typing_extensions import Literal
1920

2021
from .._models import BaseModel
@@ -33,3 +34,6 @@ class GoogleSearchCallContent(BaseModel):
3334
"""The arguments to pass to Google Search."""
3435

3536
type: Literal["google_search_call"]
37+
38+
search_type: Optional[Literal["web_search", "image_search"]] = None
39+
"""The type of search grounding enabled."""

google/genai/_interactions/types/google_search_call_content_param.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,6 @@ class GoogleSearchCallContentParam(TypedDict, total=False):
3434
"""The arguments to pass to Google Search."""
3535

3636
type: Required[Literal["google_search_call"]]
37+
38+
search_type: Literal["web_search", "image_search"]
39+
"""The type of search grounding enabled."""

google/genai/_interactions/types/image_config.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
class ImageConfig(BaseModel):
2727
"""The configuration for image interaction."""
2828

29-
aspect_ratio: Optional[Literal["1:1", "2:3", "3:2", "3:4", "4:3", "4:5", "5:4", "9:16", "16:9", "21:9"]] = None
29+
aspect_ratio: Optional[
30+
Literal["1:1", "2:3", "3:2", "3:4", "4:3", "4:5", "5:4", "9:16", "16:9", "21:9", "1:8", "8:1", "1:4", "4:1"]
31+
] = None
3032

31-
image_size: Optional[Literal["1K", "2K", "4K"]] = None
33+
image_size: Optional[Literal["1K", "2K", "4K", "512"]] = None

google/genai/_interactions/types/image_config_param.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
class ImageConfigParam(TypedDict, total=False):
2626
"""The configuration for image interaction."""
2727

28-
aspect_ratio: Literal["1:1", "2:3", "3:2", "3:4", "4:3", "4:5", "5:4", "9:16", "16:9", "21:9"]
28+
aspect_ratio: Literal[
29+
"1:1", "2:3", "3:2", "3:4", "4:3", "4:5", "5:4", "9:16", "16:9", "21:9", "1:8", "8:1", "1:4", "4:1"
30+
]
2931

30-
image_size: Literal["1K", "2K", "4K"]
32+
image_size: Literal["1K", "2K", "4K", "512"]

google/genai/_interactions/types/tool.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ class GoogleSearch(BaseModel):
3333

3434
type: Literal["google_search"]
3535

36+
search_types: Optional[List[Literal["web_search", "image_search"]]] = None
37+
"""The types of search grounding to enable."""
38+
3639

3740
class CodeExecution(BaseModel):
3841
"""A tool that can be used by the model to execute code."""

google/genai/_interactions/types/tool_param.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
from __future__ import annotations
1919

20-
from typing import Dict, Union, Iterable
20+
from typing import Dict, List, Union, Iterable
2121
from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict
2222

2323
from .._types import SequenceNotStr
@@ -33,6 +33,9 @@ class GoogleSearch(TypedDict, total=False):
3333

3434
type: Required[Literal["google_search"]]
3535

36+
search_types: List[Literal["web_search", "image_search"]]
37+
"""The types of search grounding to enable."""
38+
3639

3740
class CodeExecution(TypedDict, total=False):
3841
"""A tool that can be used by the model to execute code."""

0 commit comments

Comments
 (0)