Skip to content

CartesiaProvider

Namespace: Vercel.AI.Cartesia

public sealed class CartesiaProvider : OpenAICompatibleProvider

Cartesia provider.

Inheritance: object → ProviderBase → OpenAICompatibleProvider

View source

CartesiaProvider(HttpClient, OpenAICompatibleOptions?)

Section titled “CartesiaProvider(HttpClient, OpenAICompatibleOptions?)”
public CartesiaProvider(HttpClient httpClient, OpenAICompatibleOptions? options = null)

Creates a provider.

Parameters

Name Type Description
httpClient HttpClient
options OpenAICompatibleOptions

View source

public const string DefaultBaseUrl = "https://api.cartesia.ai"

Default API origin.

Value: string

View source

public const string ProviderId = "cartesia"

Provider id.

Value: string

View source

public static JsonObject ErrorSchema { get; }

Schema of a Cartesia error body.

Value: JsonObject

View source

Create(OpenAICompatibleOptions?, HttpMessageHandler?)

Section titled “Create(OpenAICompatibleOptions?, HttpMessageHandler?)”
public static CartesiaProvider Create(OpenAICompatibleOptions? options = null, HttpMessageHandler? handler = null)

Creates a provider.

Parameters

Name Type Description
options OpenAICompatibleOptions
handler HttpMessageHandler

Returns: CartesiaProvider

View source

GenerateSpeechAsync(string, SpeechCallOptions, IDictionary<string, string>?, CancellationToken)

Section titled “GenerateSpeechAsync(string, SpeechCallOptions, IDictionary<string, string>?, CancellationToken)”
public Task<SpeechResult> GenerateSpeechAsync(string modelId, SpeechCallOptions options, IDictionary<string, string>? headers, CancellationToken cancellationToken)

Synthesizes speech. <code class=“paramref”>headers</code> override the provider headers.

Parameters

Name Type Description
modelId string
options SpeechCallOptions
headers IDictionary<string, string>
cancellationToken CancellationToken

Returns: Task<SpeechResult>

View source

public override ILanguageModel LanguageModel(string modelId)

Returns a language model.

Parameters

Name Type Description
modelId string

Returns: ILanguageModel

View source

public override ISpeechModel SpeechModel(string modelId)

Returns a speech model.

Parameters

Name Type Description
modelId string

Returns: ISpeechModel

View source

public override ITranscriptionModel TranscriptionModel(string modelId)

Returns a transcription model.

Parameters

Name Type Description
modelId string

Returns: ITranscriptionModel

View source

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