SpeechTextStream
Namespace: Vercel.AI.Operations
public sealed class SpeechTextStream : IAsyncEnumerable<SpeechTextPart>The text a speech model reads. The provider owns it once doStream is called: it must enumerate it to the end
or dispose its enumerator on every terminal path.
Inheritance: object
Implements: IAsyncEnumerable<SpeechTextPart>
Constructors
Section titled “Constructors”SpeechTextStream(IAsyncEnumerable<SpeechTextPart>)
Section titled “SpeechTextStream(IAsyncEnumerable<SpeechTextPart>)”public SpeechTextStream(IAsyncEnumerable<SpeechTextPart> source)Creates a stream over <code class=“paramref”>source</code>.
Parameters
| Name | Type | Description |
|---|---|---|
source |
IAsyncEnumerable<SpeechTextPart> |
Properties
Section titled “Properties”Locked
Section titled “Locked”public bool Locked { get; }True after the model takes the enumerator.
Value: bool
Methods
Section titled “Methods”CancelAsync()
Section titled “CancelAsync()”public Task CancelAsync()Releases a stream no model took. A locked stream stays with the model.
Returns: Task
GetAsyncEnumerator(CancellationToken)
Section titled “GetAsyncEnumerator(CancellationToken)”public IAsyncEnumerator<SpeechTextPart> GetAsyncEnumerator(CancellationToken cancellationToken = default)Takes the single enumerator.
Parameters
| Name | Type | Description |
|---|---|---|
cancellationToken |
CancellationToken |
Returns: IAsyncEnumerator<SpeechTextPart>
Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product