BlackForestLabsProvider
Namespace: Vercel.AI.BlackForestLabs
public sealed class BlackForestLabsProvider : OpenAICompatibleProviderBlackForestLabs provider.
Inheritance: object → ProviderBase → OpenAICompatibleProvider
Constructors
Section titled “Constructors”BlackForestLabsProvider(HttpClient, OpenAICompatibleOptions?, int?, int?)
Section titled “BlackForestLabsProvider(HttpClient, OpenAICompatibleOptions?, int?, int?)”public BlackForestLabsProvider(HttpClient httpClient, OpenAICompatibleOptions? options = null, int? pollIntervalMillis = null, int? pollTimeoutMillis = null)Creates a provider. The poll settings apply to every image and video model it creates.
Parameters
| Name | Type | Description |
|---|---|---|
httpClient |
HttpClient | |
options |
OpenAICompatibleOptions | |
pollIntervalMillis |
int? | |
pollTimeoutMillis |
int? |
Fields
Section titled “Fields”DefaultBaseUrl
Section titled “DefaultBaseUrl”public const string DefaultBaseUrl = "https://api.bfl.ai/v1"Default API origin.
Value: string
ProviderId
Section titled “ProviderId”public const string ProviderId = "black-forest-labs"Provider id.
Value: string
Properties
Section titled “Properties”HttpClient
Section titled “HttpClient”public HttpClient HttpClient { get; }HTTP client used for submit, poll, and download requests.
Value: HttpClient
PollIntervalMillis
Section titled “PollIntervalMillis”public int? PollIntervalMillis { get; }Poll interval in milliseconds between status checks. Null uses 500ms for images and 2s for video.
Value: int?
PollTimeoutMillis
Section titled “PollTimeoutMillis”public int? PollTimeoutMillis { get; }Overall timeout in milliseconds for polling before giving up. Null uses 60s for images and 10 minutes for video.
Value: int?
Methods
Section titled “Methods”Create(OpenAICompatibleOptions?, HttpMessageHandler?, int?, int?)
Section titled “Create(OpenAICompatibleOptions?, HttpMessageHandler?, int?, int?)”public static BlackForestLabsProvider Create(OpenAICompatibleOptions? options = null, HttpMessageHandler? handler = null, int? pollIntervalMillis = null, int? pollTimeoutMillis = null)Creates a provider.
Parameters
| Name | Type | Description |
|---|---|---|
options |
OpenAICompatibleOptions | Provider options. |
handler |
HttpMessageHandler | Optional message handler. The provider follows redirects by hand so a status poll cannot send the API key to another host. For that reason it sets AllowAutoRedirect = false on a supplied HttpClientHandler or (on .NET 5 and later) SocketsHttpHandler, including one wrapped in DelegatingHandlers. This changes the handler you pass, and it throws if the handler has already sent a request. Any other handler type that exposes a public settable bool AllowAutoRedirect property is changed by reflection. Any remaining handler is left as is. It must not follow redirects on its own. |
pollIntervalMillis |
int? | Poll interval in milliseconds between status checks. |
pollTimeoutMillis |
int? | Overall polling timeout in milliseconds. |
Returns: BlackForestLabsProvider
EmbeddingModel(string)
Section titled “EmbeddingModel(string)”public override IEmbeddingModel EmbeddingModel(string modelId)Returns an embedding model.
Parameters
| Name | Type | Description |
|---|---|---|
modelId |
string |
Returns: IEmbeddingModel
Image(string)
Section titled “Image(string)”public IImageModel Image(string modelId)Creates an image model. Same as ImageModel(string).
Parameters
| Name | Type | Description |
|---|---|---|
modelId |
string |
Returns: IImageModel
ImageModel(string)
Section titled “ImageModel(string)”public override IImageModel ImageModel(string modelId)Returns an image model.
Parameters
| Name | Type | Description |
|---|---|---|
modelId |
string |
Returns: IImageModel
LanguageModel(string)
Section titled “LanguageModel(string)”public override ILanguageModel LanguageModel(string modelId)Returns a language model.
Parameters
| Name | Type | Description |
|---|---|---|
modelId |
string |
Returns: ILanguageModel
Video(string)
Section titled “Video(string)”public IVideoModel Video(string modelId)Creates a video model. Same as VideoModel(string).
Parameters
| Name | Type | Description |
|---|---|---|
modelId |
string |
Returns: IVideoModel
VideoModel(string)
Section titled “VideoModel(string)”public override IVideoModel VideoModel(string modelId)Returns a video model.
Parameters
| Name | Type | Description |
|---|---|---|
modelId |
string |
Returns: IVideoModel
Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product