Skip to content

StreamSpeechRequest

Namespace: Vercel.AI.Operations

public sealed class StreamSpeechRequest : OperationRequest

Options for CancellationToken).

Inheritance: object → OperationRequest

View source

public bool? IncludeRawChunks { get; set; }

When true, providers include raw provider chunks in fullStream.

Value: bool?

View source

public string? Instructions { get; set; }

Speaking instructions.

Value: string

View source

public string? Language { get; set; }

ISO 639-1 language code or auto.

Value: string

View source

public ISpeechCaller? Model { get; set; }

Speech model instance. Takes precedence over ModelId. It must support streaming speech.

Value: ISpeechCaller

View source

public string? ModelId { get; set; }

Model id resolved through Default.

Value: string

View source

public Func<Exception, Task>? OnError { get; set; }

Called for each error part the provider reports. Error parts are not fatal: fullStream includes them and audioStream skips them. The callback is not awaited, and errors it throws are ignored. Defaults to writing the error to Error.

Value: Func<Exception, Task>

View source

public SpeechAudioFormat? OutputFormat { get; set; }

Desired format of the output audio chunks. Supported formats are provider-specific.

Value: SpeechAudioFormat

View source

public double? Speed { get; set; }

Playback speed.

Value: double?

View source

public string? Text { get; set; }

The text to convert to speech, as one complete string.

Value: string

View source

public IEnumerable<SpeechTextPart>? TextParts { get; set; }

The text to convert to speech, as text parts. Strings convert implicitly to parts.

Value: IEnumerable<SpeechTextPart>

View source

public IAsyncEnumerable<SpeechTextPart>? TextStream { get; set; }

The text to convert to speech, as a stream of text deltas or parts that is synthesized as it arrives.

Value: IAsyncEnumerable<SpeechTextPart>

View source

public string? Voice { get; set; }

Voice to use.

Value: string

View source

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