Skip to content

SpeechTextPart

Namespace: Vercel.AI.Operations

public sealed class SpeechTextPart

One piece of streamed input text. Consecutive parts are synthesized in order as one continuous script. Maps to SpeechTextPart and SpeechModelV4StreamTextPart.

Inheritance: object

View source

SpeechTextPart(string, string?, JsonElement?)

Section titled “SpeechTextPart(string, string?, JsonElement?)”
public SpeechTextPart(string text, string? voice = null, JsonElement? providerOptions = null)

Creates a text part.

Parameters

Name Type Description
text string
voice string
providerOptions JsonElement?

View source

public JsonElement? ProviderOptions { get; }

Additional provider-specific options for this part, keyed by provider name.

Value: JsonElement?

View source

public string Text { get; }

The text to synthesize. Parts may split anywhere, including mid-word.

Value: string

View source

public string? Voice { get; }

The voice that speaks this part (provider-specific, like the call’s voice). Defaults to the call’s voice. Single-voice providers fail the stream when it differs from the voice of the call.

Value: string

View source

public static implicit operator SpeechTextPart(string text)

Wraps a plain string as a text part.

Parameters

Name Type Description
text string

Returns: SpeechTextPart

View source

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