Skip to content

SpeechModelStreamCall

Namespace: Vercel.AI.Operations

public sealed class SpeechModelStreamCall

Arguments for doStream on a speech model. Maps to SpeechModelV4StreamOptions.

Inheritance: object

View source

SpeechModelStreamCall(SpeechTextStream, string?, SpeechAudioFormat?, string?, double?, string?, JsonElement, IReadOnlyDictionary<string, string>, bool?, CancellationToken)

Section titled “SpeechModelStreamCall(SpeechTextStream, string?, SpeechAudioFormat?, string?, double?, string?, JsonElement, IReadOnlyDictionary<string, string>, bool?, CancellationToken)”
public SpeechModelStreamCall(SpeechTextStream text, string? voice, SpeechAudioFormat? outputFormat, string? instructions, double? speed, string? language, JsonElement providerOptions, IReadOnlyDictionary<string, string> headers, bool? includeRawChunks, CancellationToken cancellationToken)

Creates a speech stream call.

Parameters

Name Type Description
text SpeechTextStream
voice string
outputFormat SpeechAudioFormat
instructions string
speed double?
language string
providerOptions JsonElement
headers IReadOnlyDictionary<string, string>
includeRawChunks bool?
cancellationToken CancellationToken

View source

public CancellationToken CancellationToken { get; }

Cancels the operation. Also fires when the consumer cancels the result stream.

Value: CancellationToken

View source

public IReadOnlyDictionary<string, string> Headers { get; }

Headers including the user-agent suffix.

Value: IReadOnlyDictionary<string, string>

View source

public bool? IncludeRawChunks { get; }

When true, providers include raw provider chunks in the stream.

Value: bool?

View source

public string? Instructions { get; }

Speaking instructions.

Value: string

View source

public string? Language { get; }

ISO 639-1 language code or auto.

Value: string

View source

public SpeechAudioFormat? OutputFormat { get; }

Desired format of the output audio chunks. The provider default applies when null.

Value: SpeechAudioFormat

View source

public JsonElement ProviderOptions { get; }

Provider options. Empty object when omitted.

Value: JsonElement

View source

public double? Speed { get; }

Playback speed.

Value: double?

View source

public SpeechTextStream Text { get; }

Text to convert to speech, as a stream of text parts. The provider owns it once doStream is called and releases it on every terminal path.

Value: SpeechTextStream

View source

public string? Voice { get; }

Voice to use. Provider-specific.

Value: string

View source

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