FalProvider
Namespace: Vercel.AI.Fal
public sealed class FalProvider : OpenAICompatibleProviderFal provider.
Inheritance: object → ProviderBase → OpenAICompatibleProvider
Constructors
Section titled “Constructors”FalProvider(HttpClient, OpenAICompatibleOptions?)
Section titled “FalProvider(HttpClient, OpenAICompatibleOptions?)”public FalProvider(HttpClient httpClient, OpenAICompatibleOptions? options = null)Creates a provider.
Parameters
| Name | Type | Description |
|---|---|---|
httpClient |
HttpClient | |
options |
OpenAICompatibleOptions |
Fields
Section titled “Fields”DefaultBaseUrl
Section titled “DefaultBaseUrl”public const string DefaultBaseUrl = "https://fal.run"Default API origin.
Value: string
ProviderId
Section titled “ProviderId”public const string ProviderId = "fal"Provider id.
Value: string
Methods
Section titled “Methods”Create(OpenAICompatibleOptions?, HttpMessageHandler?)
Section titled “Create(OpenAICompatibleOptions?, HttpMessageHandler?)”public static FalProvider Create(OpenAICompatibleOptions? options = null, HttpMessageHandler? handler = null)Creates a provider.
Parameters
| Name | Type | Description |
|---|---|---|
options |
OpenAICompatibleOptions | |
handler |
HttpMessageHandler |
Returns: FalProvider
GenerateImageAsync(string, ImageCallOptions, IDictionary<string, string>?, CancellationToken)
Section titled “GenerateImageAsync(string, ImageCallOptions, IDictionary<string, string>?, CancellationToken)”public Task<ImageGenerationResult> GenerateImageAsync(string modelId, ImageCallOptions options, IDictionary<string, string>? headers, CancellationToken cancellationToken)Posts <code class=“paramref”>options</code> to {base}/{modelId}. <code class=“paramref”>headers</code> override the provider headers.
Parameters
| Name | Type | Description |
|---|---|---|
modelId |
string | |
options |
ImageCallOptions | |
headers |
IDictionary<string, string> | |
cancellationToken |
CancellationToken |
Returns: Task<ImageGenerationResult>
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
SpeechModel(string)
Section titled “SpeechModel(string)”public override ISpeechModel SpeechModel(string modelId)Returns a speech model.
Parameters
| Name | Type | Description |
|---|---|---|
modelId |
string |
Returns: ISpeechModel
TranscriptionModel(string)
Section titled “TranscriptionModel(string)”public override ITranscriptionModel TranscriptionModel(string modelId)Returns a transcription model.
Parameters
| Name | Type | Description |
|---|---|---|
modelId |
string |
Returns: ITranscriptionModel
Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product