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
3 changes: 3 additions & 0 deletions google/genai/_gaos/types/interactions/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,7 @@
)
from .videodelta import VideoDelta, VideoDeltaMimeType, VideoDeltaTypedDict
from .videoresponseformat import (
Resolution,
VideoResponseFormat,
VideoResponseFormatAspectRatio,
VideoResponseFormatDelivery,
Expand Down Expand Up @@ -655,6 +656,7 @@
"RagStoreConfigParam",
"Ranking",
"RankingParam",
"Resolution",
"ResponseFormat",
"ResponseFormatParam",
"ResponseModality",
Expand Down Expand Up @@ -1150,6 +1152,7 @@
"VideoDelta": ".videodelta",
"VideoDeltaMimeType": ".videodelta",
"VideoDeltaTypedDict": ".videodelta",
"Resolution": ".videoresponseformat",
"VideoResponseFormat": ".videoresponseformat",
"VideoResponseFormatAspectRatio": ".videoresponseformat",
"VideoResponseFormatDelivery": ".videoresponseformat",
Expand Down
1 change: 1 addition & 0 deletions google/genai/_gaos/types/interactions/videoconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"image_to_video",
"reference_to_video",
"edit",
"extend",
],
UnrecognizedStr,
]
Expand Down
21 changes: 20 additions & 1 deletion google/genai/_gaos/types/interactions/videoresponseformat.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,18 @@
r"""The delivery mode for the video output."""


Resolution = Union[
Literal[
"360p",
"720p",
"1080p",
"4k",
],
UnrecognizedStr,
]
r"""The video output resolution. Defaults to 720p."""


class VideoResponseFormatParam(TypedDict):
r"""Configuration for video output format."""

Expand All @@ -59,6 +71,8 @@ class VideoResponseFormatParam(TypedDict):
r"""The Cloud Storage URI to store the video output. Required for Vertex if
delivery mode is URI.
"""
resolution: NotRequired[Resolution]
r"""The video output resolution. Defaults to 720p."""
type: Literal["video"]


Expand All @@ -79,14 +93,19 @@ class VideoResponseFormat(BaseModel):
delivery mode is URI.
"""

resolution: Optional[Resolution] = None
r"""The video output resolution. Defaults to 720p."""

type: Annotated[
Annotated[Literal["video"], AfterValidator(validate_const("video"))],
pydantic.Field(alias="type"),
] = "video"

@model_serializer(mode="wrap")
def serialize_model(self, handler):
optional_fields = set(["aspect_ratio", "delivery", "duration", "gcs_uri"])
optional_fields = set(
["aspect_ratio", "delivery", "duration", "gcs_uri", "resolution"]
)
serialized = handler(self)
m = {}

Expand Down
Loading