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
24 changes: 15 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1337,7 +1337,9 @@ from google.genai import types
# Create operation
operation = client.models.generate_videos(
model='veo-3.1-generate-preview',
prompt='A neon hologram of a cat driving at top speed',
source=types.GenerateVideosSource(
prompt='A neon hologram of a cat driving at top speed',
),
config=types.GenerateVideosConfig(
number_of_videos=1,
duration_seconds=5,
Expand Down Expand Up @@ -1365,9 +1367,11 @@ image = types.Image.from_file(location="local/path/file.png")
# Create operation
operation = client.models.generate_videos(
model='veo-3.1-generate-preview',
# Prompt is optional if image is provided
prompt='Night sky',
image=image,
source=types.GenerateVideosSource(
# Prompt is optional if image is provided
prompt='Night sky',
image=image,
),
config=types.GenerateVideosConfig(
number_of_videos=1,
duration_seconds=5,
Expand Down Expand Up @@ -1399,11 +1403,13 @@ video = types.Video.from_file("local/path/video.mp4")
# Create operation
operation = client.models.generate_videos(
model='veo-3.1-generate-preview',
# Prompt is optional if Video is provided
prompt='Night sky',
# Input video must be in GCS for Gemini Enterprise Agent Platform or a URI for Gemini
video=types.Video(
uri="gs://bucket-name/inputs/videos/cat_driving.mp4",
source=types.GenerateVideosSource(
# Prompt is optional if Video is provided
prompt='Night sky',
# Input video must be in GCS for Gemini Enterprise Agent Platform or a URI for Gemini
video=types.Video(
uri="gs://bucket-name/inputs/videos/cat_driving.mp4",
),
),
config=types.GenerateVideosConfig(
number_of_videos=1,
Expand Down
2 changes: 1 addition & 1 deletion google/genai/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -7091,7 +7091,7 @@ def generate_videos(
time.sleep(10)
operation = client.operations.get(operation)

operation.result.generated_videos[0].video.uri
operation.response.generated_videos[0].video.uri
```
"""
if prompt or image or video:
Expand Down
4 changes: 2 additions & 2 deletions google/genai/operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ def get(
time.sleep(10)
operation = client.operations.get(operation)

print(operation.result)
print(operation.response)
"""
# Currently, only GenerateVideosOperation is supported.
# TODO(b/398040607): Support short form names
Expand Down Expand Up @@ -554,7 +554,7 @@ async def get(
await asyncio.sleep(10)
operation = await client.aio.operations.get(operation)

print(operation.result)
print(operation.response)
"""
# Currently, only GenerateVideosOperation is supported.
operation_name = operation.name
Expand Down
Loading