SseParser
Namespace: Vercel.AI.ProviderUtils
public static class SseParserReads Server-Sent Events data: lines.
Inheritance: object
Methods
Section titled “Methods”ReadDataAsync(Stream, CancellationToken)
Section titled “ReadDataAsync(Stream, CancellationToken)”public static IAsyncEnumerable<string> ReadDataAsync(Stream stream, CancellationToken cancellationToken = default)Yields event data. A data: [DONE] line ends the stream.
Multi-line data fields are joined with newlines.
Parameters
| Name | Type | Description |
|---|---|---|
stream |
Stream | |
cancellationToken |
CancellationToken |
Returns: IAsyncEnumerable<string>
Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product