Environment details
- Programming language: Python (also tested with REST API)
- OS: macOS
- Language runtime version: 3.12.9
- Package version: 1.16.1
Steps to reproduce
- Run the following script:
from google import genai
from google.genai import types
from pathlib import Path
import os
client = genai.Client(api_key=os.environ['GEMINI_API_KEY'])
video_path = Path("vid.mp4")
video_bytes = video_path.read_bytes()
response = client.models.generate_content(
model='models/gemini-2.5-flash-preview-05-20',
contents=types.Content(
parts=[
types.Part(
inline_data=types.Blob(
data=video_bytes,
mime_type='video/mp4',
),
video_metadata=types.VideoMetadata(
fps=5
)
),
types.Part(text='Please summarize the video in 3 sentences.')
]
)
)
This also happens with start_offset and end_offset.
Also, note, the docs page seems wrong. It has the following:
types.Part(
inline_data=types.Blob(
data=video_bytes,
mime_type='video/mp4',
video_metadata=types.VideoMetadata(fps=5)
)),
This fails with a Pydantic error when run, and according to the API reference and other examples, video_metadata is a member of Part, not Blob.
Environment details
Steps to reproduce
This also happens with start_offset and end_offset.
Also, note, the docs page seems wrong. It has the following:
This fails with a Pydantic error when run, and according to the API reference and other examples,
video_metadatais a member ofPart, notBlob.