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
8 changes: 3 additions & 5 deletions google/genai/_interactions/types/audio_response_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
from typing import Optional
from typing_extensions import Literal

from pydantic import Field as FieldInfo

from .._models import BaseModel

__all__ = ["AudioResponseFormat"]
Expand All @@ -30,7 +28,7 @@ class AudioResponseFormat(BaseModel):

type: Literal["audio"]

bit_rate: Optional[int] = FieldInfo(alias="bitRate", default=None)
bit_rate: Optional[int] = None
"""Bit rate in bits per second (bps).

Only applicable for compressed formats (MP3, Opus).
Expand All @@ -41,8 +39,8 @@ class AudioResponseFormat(BaseModel):

mime_type: Optional[
Literal["audio/mp3", "audio/ogg_opus", "audio/l16", "audio/wav", "audio/alaw", "audio/mulaw"]
] = FieldInfo(alias="mimeType", default=None)
] = None
"""The MIME type of the audio output."""

sample_rate: Optional[int] = FieldInfo(alias="sampleRate", default=None)
sample_rate: Optional[int] = None
"""Sample rate in Hz."""
13 changes: 4 additions & 9 deletions google/genai/_interactions/types/audio_response_format_param.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@

from __future__ import annotations

from typing_extensions import Literal, Required, Annotated, TypedDict

from .._utils import PropertyInfo
from typing_extensions import Literal, Required, TypedDict

__all__ = ["AudioResponseFormatParam"]

Expand All @@ -29,7 +27,7 @@ class AudioResponseFormatParam(TypedDict, total=False):

type: Required[Literal["audio"]]

bit_rate: Annotated[int, PropertyInfo(alias="bitRate")]
bit_rate: int
"""Bit rate in bits per second (bps).

Only applicable for compressed formats (MP3, Opus).
Expand All @@ -38,11 +36,8 @@ class AudioResponseFormatParam(TypedDict, total=False):
delivery: Literal["inline", "url"]
"""The delivery mode for the audio output."""

mime_type: Annotated[
Literal["audio/mp3", "audio/ogg_opus", "audio/l16", "audio/wav", "audio/alaw", "audio/mulaw"],
PropertyInfo(alias="mimeType"),
]
mime_type: Literal["audio/mp3", "audio/ogg_opus", "audio/l16", "audio/wav", "audio/alaw", "audio/mulaw"]
"""The MIME type of the audio output."""

sample_rate: Annotated[int, PropertyInfo(alias="sampleRate")]
sample_rate: int
"""Sample rate in Hz."""
8 changes: 3 additions & 5 deletions google/genai/_interactions/types/image_response_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
from typing import Optional
from typing_extensions import Literal

from pydantic import Field as FieldInfo

from .._models import BaseModel

__all__ = ["ImageResponseFormat"]
Expand All @@ -32,14 +30,14 @@ class ImageResponseFormat(BaseModel):

aspect_ratio: Optional[
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"]
] = FieldInfo(alias="aspectRatio", default=None)
] = None
"""The aspect ratio for the image output."""

delivery: Optional[Literal["inline", "url"]] = None
"""The delivery mode for the image output."""

image_size: Optional[Literal["512", "1K", "2K", "4K"]] = FieldInfo(alias="imageSize", default=None)
image_size: Optional[Literal["512", "1K", "2K", "4K"]] = None
"""The size of the image output."""

mime_type: Optional[Literal["image/jpeg"]] = FieldInfo(alias="mimeType", default=None)
mime_type: Optional[Literal["image/jpeg"]] = None
"""The MIME type of the image output."""
13 changes: 5 additions & 8 deletions google/genai/_interactions/types/image_response_format_param.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@

from __future__ import annotations

from typing_extensions import Literal, Required, Annotated, TypedDict

from .._utils import PropertyInfo
from typing_extensions import Literal, Required, TypedDict

__all__ = ["ImageResponseFormatParam"]

Expand All @@ -29,17 +27,16 @@ class ImageResponseFormatParam(TypedDict, total=False):

type: Required[Literal["image"]]

aspect_ratio: Annotated[
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"],
PropertyInfo(alias="aspectRatio"),
aspect_ratio: 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"
]
"""The aspect ratio for the image output."""

delivery: Literal["inline", "url"]
"""The delivery mode for the image output."""

image_size: Annotated[Literal["512", "1K", "2K", "4K"], PropertyInfo(alias="imageSize")]
image_size: Literal["512", "1K", "2K", "4K"]
"""The size of the image output."""

mime_type: Annotated[Literal["image/jpeg"], PropertyInfo(alias="mimeType")]
mime_type: Literal["image/jpeg"]
"""The MIME type of the image output."""
2 changes: 1 addition & 1 deletion google/genai/_interactions/types/text_response_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class TextResponseFormat(BaseModel):

type: Literal["text"]

mime_type: Optional[Literal["application/json", "text/plain"]] = FieldInfo(alias="mimeType", default=None)
mime_type: Optional[Literal["application/json", "text/plain"]] = None
"""The MIME type of the text output."""

schema_: Optional[Dict[str, object]] = FieldInfo(alias="schema", default=None)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@
from __future__ import annotations

from typing import Dict
from typing_extensions import Literal, Required, Annotated, TypedDict

from .._utils import PropertyInfo
from typing_extensions import Literal, Required, TypedDict

__all__ = ["TextResponseFormatParam"]

Expand All @@ -30,7 +28,7 @@ class TextResponseFormatParam(TypedDict, total=False):

type: Required[Literal["text"]]

mime_type: Annotated[Literal["application/json", "text/plain"], PropertyInfo(alias="mimeType")]
mime_type: Literal["application/json", "text/plain"]
"""The MIME type of the text output."""

schema: Dict[str, object]
Expand Down
4 changes: 1 addition & 3 deletions google/genai/_interactions/types/tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
from typing import Dict, List, Union, Optional
from typing_extensions import Literal, Annotated, TypeAlias

from pydantic import Field as FieldInfo

from .._utils import PropertyInfo
from .._models import BaseModel
from .function import Function
Expand Down Expand Up @@ -59,7 +57,7 @@ class ComputerUse(BaseModel):
environment: Optional[Literal["browser"]] = None
"""The environment being operated."""

excluded_predefined_functions: Optional[List[str]] = FieldInfo(alias="excludedPredefinedFunctions", default=None)
excluded_predefined_functions: Optional[List[str]] = None
"""The list of predefined functions that are excluded from the model call."""


Expand Down
5 changes: 2 additions & 3 deletions google/genai/_interactions/types/tool_param.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,9 @@
from __future__ import annotations

from typing import Dict, List, Union, Iterable
from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict
from typing_extensions import Literal, Required, TypeAlias, TypedDict

from .._types import SequenceNotStr
from .._utils import PropertyInfo
from .function_param import FunctionParam
from .allowed_tools_param import AllowedToolsParam

Expand Down Expand Up @@ -59,7 +58,7 @@ class ComputerUse(TypedDict, total=False):
environment: Literal["browser"]
"""The environment being operated."""

excluded_predefined_functions: Annotated[SequenceNotStr[str], PropertyInfo(alias="excludedPredefinedFunctions")]
excluded_predefined_functions: SequenceNotStr[str]
"""The list of predefined functions that are excluded from the model call."""


Expand Down
Loading