Interface IVideoGenerator

Abstraction over a video generation backend (Runway, Pika, Kling, Luma, Stable Video, Google Veo, Replicate, etc.).

Capability negotiation

Not every provider supports every modality. The supports method lets callers (and the FallbackVideoProxy) query whether a given capability is available before invoking it.

Lifecycle

  1. Construct the provider.
  2. Call initialize with provider-specific configuration (API keys, base URLs, etc.).
  3. Use generateVideo and/or imageToVideo.
  4. Optionally call shutdown to release resources.
interface IVideoGenerator {
    providerId: string;
    isInitialized: boolean;
    defaultModelId?: string;
    initialize(config): Promise<void>;
    generateVideo(request): Promise<VideoResult>;
    imageToVideo?(request): Promise<VideoResult>;
    supports(capability): boolean;
    shutdown?(): Promise<void>;
}

Implemented by

Methods

  • Initialise the provider with runtime configuration.

    Parameters

    • config: Record<string, unknown>

      Provider-specific key/value pairs (API keys, endpoints, model overrides, etc.).

    Returns Promise<void>

  • Generate a video from a source image and a motion prompt.

    This method is optional — providers that do not support image-to-video should either omit it or have supports return false for 'image-to-video'.

    Parameters

    Returns Promise<VideoResult>

    A result envelope containing one or more generated videos.

  • Query whether this provider supports a given capability.

    Parameters

    • capability: "text-to-video" | "image-to-video"

      The capability to check.

    Returns boolean

    true if the provider can handle the requested capability.

  • Release any resources held by the provider (HTTP connections, polling loops, temp files, etc.).

    Returns Promise<void>

Properties

providerId: string

Unique identifier for this provider (e.g. 'runway', 'pika').

isInitialized: boolean

Whether initialize has been called successfully.

defaultModelId?: string

Default model used when the request omits modelId.