Skip to content

Commit c3bdb88

Browse files
google-genai-botcopybara-github
authored andcommitted
feat: add video resolution and extension task parameters
PiperOrigin-RevId: 964340822
1 parent 2dd9537 commit c3bdb88

3 files changed

Lines changed: 24 additions & 1 deletion

File tree

google/genai/_gaos/types/interactions/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,7 @@
398398
)
399399
from .videodelta import VideoDelta, VideoDeltaMimeType, VideoDeltaTypedDict
400400
from .videoresponseformat import (
401+
Resolution,
401402
VideoResponseFormat,
402403
VideoResponseFormatAspectRatio,
403404
VideoResponseFormatDelivery,
@@ -655,6 +656,7 @@
655656
"RagStoreConfigParam",
656657
"Ranking",
657658
"RankingParam",
659+
"Resolution",
658660
"ResponseFormat",
659661
"ResponseFormatParam",
660662
"ResponseModality",
@@ -1150,6 +1152,7 @@
11501152
"VideoDelta": ".videodelta",
11511153
"VideoDeltaMimeType": ".videodelta",
11521154
"VideoDeltaTypedDict": ".videodelta",
1155+
"Resolution": ".videoresponseformat",
11531156
"VideoResponseFormat": ".videoresponseformat",
11541157
"VideoResponseFormatAspectRatio": ".videoresponseformat",
11551158
"VideoResponseFormatDelivery": ".videoresponseformat",

google/genai/_gaos/types/interactions/videoconfig.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
"image_to_video",
3030
"reference_to_video",
3131
"edit",
32+
"extend",
3233
],
3334
UnrecognizedStr,
3435
]

google/genai/_gaos/types/interactions/videoresponseformat.py

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,18 @@
4646
r"""The delivery mode for the video output."""
4747

4848

49+
Resolution = Union[
50+
Literal[
51+
"360p",
52+
"720p",
53+
"1080p",
54+
"4k",
55+
],
56+
UnrecognizedStr,
57+
]
58+
r"""The video output resolution. Defaults to 720p."""
59+
60+
4961
class VideoResponseFormatParam(TypedDict):
5062
r"""Configuration for video output format."""
5163

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

6478

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

96+
resolution: Optional[Resolution] = None
97+
r"""The video output resolution. Defaults to 720p."""
98+
8299
type: Annotated[
83100
Annotated[Literal["video"], AfterValidator(validate_const("video"))],
84101
pydantic.Field(alias="type"),
85102
] = "video"
86103

87104
@model_serializer(mode="wrap")
88105
def serialize_model(self, handler):
89-
optional_fields = set(["aspect_ratio", "delivery", "duration", "gcs_uri"])
106+
optional_fields = set(
107+
["aspect_ratio", "delivery", "duration", "gcs_uri", "resolution"]
108+
)
90109
serialized = handler(self)
91110
m = {}
92111

0 commit comments

Comments
 (0)