Skip to content

BlackForestLabsVideoModel

Namespace: Vercel.AI.BlackForestLabs

public sealed class BlackForestLabsVideoModel : IVideoModel, IVideoCaller

Black Forest Labs FLUX 3 video model. CancellationToken) submits a job and CancellationToken) reads it. The video is returned as a signed URL and is never downloaded. The operation is a JSON object with the requestId, the pollingUrl, and the estimates of the submit response.

Inheritance: object

Implements: IVideoModel, IVideoCaller

View source

BlackForestLabsVideoModel(BlackForestLabsProvider, string, Func<DateTimeOffset>?)

Section titled “BlackForestLabsVideoModel(BlackForestLabsProvider, string, Func<DateTimeOffset>?)”
public BlackForestLabsVideoModel(BlackForestLabsProvider provider, string modelId, Func<DateTimeOffset>? clock = null)

Creates a model. <code class=“paramref”>clock</code> sets the response timestamp.

Parameters

Name Type Description
provider BlackForestLabsProvider
modelId string
clock Func<DateTimeOffset>

View source

public bool CanGenerate { get; }

True when doGenerate exists.

Value: bool

View source

public bool CanStart { get; }

True when doStart exists.

Value: bool

View source

public bool CanStatus { get; }

True when doStatus exists.

Value: bool

View source

public bool CanWebhook { get; }

True when handleWebhookOption exists.

Value: bool

View source

public int? MaxVideosPerCall { get; }

Black Forest Labs returns one video per call.

Value: int?

View source

public string ModelId { get; }

Model id.

Value: string

View source

public string Provider { get; }

Provider id.

Value: string

View source

public string SpecificationVersion { get; }

Specification version. Always v4.

Value: string

View source

DoGenerateAsync(VideoModelCall, CancellationToken)

Section titled “DoGenerateAsync(VideoModelCall, CancellationToken)”
public Task<VideoModelResult> DoGenerateAsync(VideoModelCall call, CancellationToken cancellationToken)

Starts a job and polls it until the video is ready.

Parameters

Name Type Description
call VideoModelCall
cancellationToken CancellationToken

Returns: Task<VideoModelResult>

View source

DoGenerateAsync(VideoCallOptions, CancellationToken)

Section titled “DoGenerateAsync(VideoCallOptions, CancellationToken)”
public Task<VideoResult> DoGenerateAsync(VideoCallOptions options, CancellationToken cancellationToken)

Generates a video.

Parameters

Name Type Description
options VideoCallOptions
cancellationToken CancellationToken

Returns: Task<VideoResult>

View source

DoStartAsync(VideoModelCall, CancellationToken)

Section titled “DoStartAsync(VideoModelCall, CancellationToken)”
public Task<VideoStartResult> DoStartAsync(VideoModelCall call, CancellationToken cancellationToken)

Starts an asynchronous generation.

Parameters

Name Type Description
call VideoModelCall
cancellationToken CancellationToken

Returns: Task<VideoStartResult>

View source

DoStatusAsync(VideoModelCall, CancellationToken)

Section titled “DoStatusAsync(VideoModelCall, CancellationToken)”
public Task<VideoStatusResult> DoStatusAsync(VideoModelCall call, CancellationToken cancellationToken)

Reads operation status.

Parameters

Name Type Description
call VideoModelCall
cancellationToken CancellationToken

Returns: Task<VideoStatusResult>

View source

HandleWebhookAsync(Func<Task<VideoWebhook>>, CancellationToken)

Section titled “HandleWebhookAsync(Func<Task<VideoWebhook>>, CancellationToken)”
public Task<VideoWebhook> HandleWebhookAsync(Func<Task<VideoWebhook>> webhook, CancellationToken cancellationToken)

Turns a webhook factory into a URL and a received task.

Parameters

Name Type Description
webhook Func<Task<VideoWebhook>>
cancellationToken CancellationToken

Returns: Task<VideoWebhook>

View source

ResolveMaxVideosPerCallAsync(CancellationToken)

Section titled “ResolveMaxVideosPerCallAsync(CancellationToken)”
public Task<int?> ResolveMaxVideosPerCallAsync(CancellationToken cancellationToken)

Resolves a functional limit. The default is MaxVideosPerCall.

Parameters

Name Type Description
cancellationToken CancellationToken

Returns: Task<int?>

View source

Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product