Skip to content

ValidationError: extra_forbidden and string_type blocking generate_videos with Veo 3.1 #2118

@vedika0806

Description

@vedika0806

I am getting persistent Pydantic validation errors when using the google-genai SDK on an Ubuntu 22.04 EC2 instance. The SDK is blocking the request locally before it reaches the API, claiming that standard fields are "extra inputs" or that the prompt must be a string (blocking multimodal lists).

Environment:

Library: google-genai==1.65.0

Python: 3.10.12 (venv)

Model: veo-3.1-generate-preview

Error 1 (Extra Input):
ValidationError: 1 validation error for GenerateVideosConfig image Extra inputs are not permitted [type=extra_forbidden, input_value=File(...), input_type=File]
(Note: Occurs even when using input_file or raw dictionaries)

Error 2 (Type Mismatch):
ValidationError: 1 validation error for _GenerateVideosParameters prompt Input should be a valid string [type=string_type, input_value=[File(...), "Prompt Text"], input_type=list]

Code Snippet:

Python

This standard call fails due to Pydantic strictness

operation = client.models.generate_videos(
model="veo-3.1-generate-preview",
prompt="Cinematic video",
config=types.GenerateVideosConfig(input_file=uploaded_file)
)
Request:
Can you clarify the expected Pydantic schema for the GenerateVideosConfig in version 1.65.0, or provide a way to disable strict validation for experimental models like Veo?

Metadata

Metadata

Assignees

Labels

priority: p2Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions