OperationFullStream<T>
Namespace: Vercel.AI.Operations
public sealed class OperationFullStream<T> : IAsyncEnumerable<T>A single-consumer stream with an explicit Cancel.
Type parameters
| Name | Description |
|---|---|
T |
Inheritance: object
Implements: IAsyncEnumerable<T>
Constructors
Section titled “Constructors”OperationFullStream(Func<IAsyncEnumerator<T>>, Action)
Section titled “OperationFullStream(Func<IAsyncEnumerator<T>>, Action)”public OperationFullStream(Func<IAsyncEnumerator<T>> open, Action cancel)Creates a stream.
Parameters
| Name | Type | Description |
|---|---|---|
open |
Func<IAsyncEnumerator<T>> | |
cancel |
Action |
OperationFullStream(Func<CancellationToken, IAsyncEnumerator<T>>, Action)
Section titled “OperationFullStream(Func<CancellationToken, IAsyncEnumerator<T>>, Action)”public OperationFullStream(Func<CancellationToken, IAsyncEnumerator<T>> open, Action cancel)Creates a stream whose enumerator observes the token passed to CancellationToken).
Parameters
| Name | Type | Description |
|---|---|---|
open |
Func<CancellationToken, IAsyncEnumerator<T>> | |
cancel |
Action |
Methods
Section titled “Methods”Cancel()
Section titled “Cancel()”public void Cancel()Cancels the stream and aborts a pending model call.
GetAsyncEnumerator(CancellationToken)
Section titled “GetAsyncEnumerator(CancellationToken)”public IAsyncEnumerator<T> GetAsyncEnumerator(CancellationToken cancellationToken = default)Returns the single enumerator.
Parameters
| Name | Type | Description |
|---|---|---|
cancellationToken |
CancellationToken |
Returns: IAsyncEnumerator<T>
Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product