StreamIterator<T>
Namespace: Vercel.AI.Util
public sealed class StreamIterator<T>Async iterator over a ReadableStream%601.
Type parameters
| Name | Description |
|---|---|
T |
Inheritance: object
Methods
Section titled “Methods”NextAsync()
Section titled “NextAsync()”public Task<IteratorResult<T>> NextAsync()Reads the next chunk.
Returns: Task<IteratorResult<T>>
ReturnAsync()
Section titled “ReturnAsync()”public Task<IteratorResult<T>> ReturnAsync()Stops iteration and cancels the stream.
Returns: Task<IteratorResult<T>>
ThrowAsync(Exception)
Section titled “ThrowAsync(Exception)”public Task ThrowAsync(Exception error)Stops iteration, cancels the stream, and throws <code class=“paramref”>error</code>.
Parameters
| Name | Type | Description |
|---|---|---|
error |
Exception |
Returns: Task
Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product