Skip to content

API Reference parrot.clients.google.reel.profiles

github-actions[bot] edited this page Dec 2, 2026 · 4 revisions

parrot.clients.google.reel.profiles

View source

API-specific video model capability registry (FEAT-564, spec module M2).

One :class:VideoModelProfile per exact (surface, model_id) pair — never substring matching (adding a future model is one verified entry plus a contract test, per the spec's Module 2 docstring). :class:VideoProfileRegistry resolves and validates a model before any paid provider call, and :func:select_generation_duration picks the smallest legal covering duration.

Vertex GA entries are present but enabled=False pending the spec's §8 Q5 enablement gate — no Vertex capability claim here is a live-service readiness claim; each profile's source/checked_on records where the capability data came from.

Attribute ApiSurface

Alias ReelErrorCode

Re-exported from parrot.clients.google.reel.errors.ReelErrorCode.

Alias ReelValidationError

Re-exported from parrot.clients.google.reel.errors.ReelValidationError.

Class VideoModelProfile

Verified capability record for one model on one API surface.

Fields:

Field Type Default Description
model_id str Exact provider model identifier.
surface ApiSurface API surface this entry is valid for.
backend Literal['veo', 'omni'] Adapter that generates clips for this model.
enabled bool Whether this profile may currently be resolved for use.
durations_seconds Optional[List[int]] Legal generation durations in seconds; None = provider default (Omni).
resolutions List[str] Resolutions accepted; empty when not user-selectable (Omni).
resolution_min_duration Dict[str, int] Per-resolution minimum legal duration, e.g. {"1080p": 8, "4k": 8}.
supports_starting_frame bool Whether a starting-frame image is accepted.
supports_reference_guidance bool Whether provider reference_images (asset guidance) are accepted.
native_audio Literal['always', 'controllable', 'none'] Whether/how the model can produce synchronized audio.
person_generation_values List[str] Legal lowercase person_generation wire values; empty if not applicable.
source str Where this capability data was verified.
checked_on date When the capability data was last verified.
max_outputs_per_request int Maximum videos one provider request may return (Omni > 1).

Class VideoProfileRegistry

Central registry of verified (surface, model) capability profiles.

Adding a GA model is one new :class:VideoModelProfile entry plus a contract test — never a "veo-3" in model_id-style substring check.

Parameter Type Default Description
profiles Iterable[VideoModelProfile]

Method VideoProfileRegistry.default

Developer API: Gemini Omni (enabled).

Vertex: Veo 3.1 standard/Fast GA (enabled=False, pending spec §8 Q5).

default() -> 'VideoProfileRegistry'

Returns: 'VideoProfileRegistry'

Method VideoProfileRegistry.default_video_model

Returns the configured default model id for an API surface.

default_video_model(surface: ApiSurface) -> str

Parameter Type Default Description
surface ApiSurface The API surface to resolve a default for.

Returns: str — The default model id for that surface.

Raises:

  • ReelValidationError — If the surface has no default configured.

Method VideoProfileRegistry.resolve

Resolves an exact (model_id, surface) pair to its verified profile.

resolve(model_id: str, surface: ApiSurface) -> VideoModelProfile

Parameter Type Default Description
model_id str The exact provider model identifier requested.
surface ApiSurface The API surface the request targets.

Returns: VideoModelProfile — The matching, enabled :class:VideoModelProfile.

Raises:

  • ReelValidationError — unknown_model if no profile exists for model_id on any surface; wrong_api_surface if it exists only on a different surface; model_disabled if it exists on this surface but is not enabled.

Method VideoProfileRegistry.validate_scene

Validates a scene's requested options against a resolved profile.

Never silently drops an unsupported option — always raises instead.

validate_scene(profile: VideoModelProfile, *, resolution: str, audio_mode: str, has_starting_frame: bool) -> None

Parameter Type Default Description
profile VideoModelProfile The profile resolved via :meth:resolve.
resolution str The requested output resolution.
audio_mode str The requested AudioMode ("separate", "native" or "muted").
has_starting_frame bool Whether the scene supplies a starting frame.

Raises:

  • ReelValidationError — unsupported_option if the resolution, starting frame, or native-audio request is not supported by this profile.

Method VideoProfileRegistry.validate_request

Validate all options in one provider video request against a profile.

validate_request(profile: VideoModelProfile, *, request: VideoRequestOptions) -> None

Parameter Type Default Description
profile VideoModelProfile
request VideoRequestOptions

Raises:

  • ReelValidationError — unsupported_option when the profile cannot honour any requested option.

Class VideoRequestOptions

Normalised single-request video options validated against a profile.

Fields:

Field Type Default Description
resolution Optional[str] None
duration_seconds Optional[int] None
number_of_videos int 1
has_starting_frame bool False
has_last_frame bool False
reference_image_count int 0
extends_video bool False
audio_mode str 'separate'

Function select_generation_duration

Selects the smallest legal duration that covers target_seconds.

Applies the profile's resolution_min_duration floor first (a high-resolution request is forced up to that floor regardless of the target), then picks the smallest remaining legal duration at or above the target — falling back to the largest legal duration if the target exceeds every option (should not happen given the 8 s scene-edit cap).

select_generation_duration(profile: VideoModelProfile, target_seconds: float, resolution: str, has_starting_frame: bool) -> Optional[int]

Parameter Type Default Description
profile VideoModelProfile The resolved profile to select a duration from.
target_seconds float The scene's edit target duration.
resolution str The requested output resolution.
has_starting_frame bool Whether the scene supplies a starting frame (accepted for signature completeness; this profile set's duration math does not currently vary on it).

Returns: Optional[int] — The chosen legal duration in seconds, or None when the backend has no user-selectable duration (Omni: provider default).

Raises:

  • ReelValidationError — If no legal duration satisfies the resolution's minimum-duration floor.

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally