Skip to content

CartesiaSpeechModel

Namespace: Vercel.AI.Cartesia

public sealed class CartesiaSpeechModel : ISpeechModel, ISpeechCaller

Cartesia text-to-speech model. Posts to /tts/bytes.

Inheritance: object

Implements: ISpeechModel, ISpeechCaller

View source

CartesiaSpeechModel(CartesiaProvider, string, Func<DateTime>?)

Section titled “CartesiaSpeechModel(CartesiaProvider, string, Func<DateTime>?)”
public CartesiaSpeechModel(CartesiaProvider provider, string modelId, Func<DateTime>? clock = null)

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

Parameters

Name Type Description
provider CartesiaProvider
modelId string
clock Func<DateTime>

View source

public string ModelId { get; }

Model id.

Value: string

View source

public string Provider { get; }

Provider id.

Value: string

View source

DoGenerateAsync(SpeechModelCall, CancellationToken)

Section titled “DoGenerateAsync(SpeechModelCall, CancellationToken)”
public Task<SpeechModelResult> DoGenerateAsync(SpeechModelCall call, CancellationToken cancellationToken)

Generates speech audio.

Parameters

Name Type Description
call SpeechModelCall
cancellationToken CancellationToken

Returns: Task<SpeechModelResult>

View source

DoGenerateAsync(SpeechCallOptions, CancellationToken)

Section titled “DoGenerateAsync(SpeechCallOptions, CancellationToken)”
public Task<SpeechResult> DoGenerateAsync(SpeechCallOptions options, CancellationToken cancellationToken)

Synthesizes speech.

Parameters

Name Type Description
options SpeechCallOptions
cancellationToken CancellationToken

Returns: Task<SpeechResult>

View source

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