SpeechModelStreamCall
Namespace: Vercel.AI.Operations
public sealed class SpeechModelStreamCallArguments for doStream on a speech model. Maps to SpeechModelV4StreamOptions.
Inheritance: object
Constructors
Section titled “Constructors”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 |
Properties
Section titled “Properties”CancellationToken
Section titled “CancellationToken”public CancellationToken CancellationToken { get; }Cancels the operation. Also fires when the consumer cancels the result stream.
Value: CancellationToken
Headers
Section titled “Headers”public IReadOnlyDictionary<string, string> Headers { get; }Headers including the user-agent suffix.
Value: IReadOnlyDictionary<string, string>
IncludeRawChunks
Section titled “IncludeRawChunks”public bool? IncludeRawChunks { get; }When true, providers include raw provider chunks in the stream.
Value: bool?
Instructions
Section titled “Instructions”public string? Instructions { get; }Speaking instructions.
Value: string
Language
Section titled “Language”public string? Language { get; }ISO 639-1 language code or auto.
Value: string
OutputFormat
Section titled “OutputFormat”public SpeechAudioFormat? OutputFormat { get; }Desired format of the output audio chunks. The provider default applies when null.
Value: SpeechAudioFormat
ProviderOptions
Section titled “ProviderOptions”public JsonElement ProviderOptions { get; }Provider options. Empty object when omitted.
Value: JsonElement
public double? Speed { get; }Playback speed.
Value: double?
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
public string? Voice { get; }Voice to use. Provider-specific.
Value: string
Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product