mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-10-06 02:09:40 +00:00
Read every provider stream through one server-sent event reader
This commit is contained in:
2 files changed
+133
-195
No files matched your search
@@ -0,0 +1,13 @@
|
||||
namespace AIStudio.Provider;
|
||||
|
||||
/// <summary>
|
||||
/// One event of a server-sent event stream, as it came off the wire.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// The raw line travels next to its payload because not every decision can be made from the
|
||||
/// payload alone: the Responses API, for one, ends its stream with an "event:" line which carries
|
||||
/// no payload at all.
|
||||
/// </remarks>
|
||||
/// <param name="Line">The line as it arrived, including its "data:" prefix when it had one.</param>
|
||||
/// <param name="Data">The payload of a data line, empty for every other kind of line.</param>
|
||||
public readonly record struct ServerSentEvent(string Line, string Data);
|
||||
Reference in new issue
Block a user