StreamSpeechRequest
Namespace: Vercel.AI.Operations
public sealed class StreamSpeechRequest : OperationRequestOptions for CancellationToken).
Inheritance: object → OperationRequest
Properties
Section titled “Properties”IncludeRawChunks
Section titled “IncludeRawChunks”public bool? IncludeRawChunks { get; set; }When true, providers include raw provider chunks in fullStream.
Value: bool?
Instructions
Section titled “Instructions”public string? Instructions { get; set; }Speaking instructions.
Value: string
Language
Section titled “Language”public string? Language { get; set; }ISO 639-1 language code or auto.
Value: string
public ISpeechCaller? Model { get; set; }Speech model instance. Takes precedence over ModelId. It must support streaming speech.
Value: ISpeechCaller
ModelId
Section titled “ModelId”public string? ModelId { get; set; }Model id resolved through Default.
Value: string
OnError
Section titled “OnError”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>
OutputFormat
Section titled “OutputFormat”public SpeechAudioFormat? OutputFormat { get; set; }Desired format of the output audio chunks. Supported formats are provider-specific.
Value: SpeechAudioFormat
public double? Speed { get; set; }Playback speed.
Value: double?
public string? Text { get; set; }The text to convert to speech, as one complete string.
Value: string
TextParts
Section titled “TextParts”public IEnumerable<SpeechTextPart>? TextParts { get; set; }The text to convert to speech, as text parts. Strings convert implicitly to parts.
Value: IEnumerable<SpeechTextPart>
TextStream
Section titled “TextStream”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>
public string? Voice { get; set; }Voice to use.
Value: string
Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product