Function getVideoProviderOptions

  • Read one provider's options from a request's providerOptions.

    A bag that holds the provider's own id, or the id of any built-in video provider (fal, replicate, runway, gemini) or of a provider registered with registerVideoProviderFactory(), is keyed by provider: the provider receives its own entry, or nothing when the bag has none for it. A bag with no such key is flat and is returned whole to every provider that reads its options. Keys match provider ids whatever their case.

    Parameters

    • providerId: string

      The id of the provider reading its options.

    • Optional providerOptions: Record<string, unknown> | VideoProviderOptionBag

      The request's providerOptions.

    Returns Record<string, unknown> | undefined

    The provider's options, or undefined when there are none.

    Example

    getVideoProviderOptions('fal', { fal: { end_image_url: url }, replicate: { last_frame: url } });
    // -> { end_image_url: url }
    getVideoProviderOptions('fal', { prompt_optimizer: false });
    // -> { prompt_optimizer: false }