4 instantiations of SseItem
Microsoft.Extensions.AI.OpenAI (4)
OpenAISerializationHelpers.cs (2)
87
yield return
new
(binaryData);
90
yield return
new
(_finalSseEvent);
src\Shared\ServerSentEvents\SseParser_1.cs (2)
344
sseItem = new
SseItem
<T>(data, _eventType) { EventId = _eventId, ReconnectionInterval = _nextReconnectionInterval };
398
sseItem = new
SseItem
<T>(data, _eventType) { EventId = _eventId, ReconnectionInterval = _nextReconnectionInterval };
17 references to SseItem
Microsoft.Extensions.AI.OpenAI (17)
OpenAISerializationHelpers.cs (2)
82
static async IAsyncEnumerable<
SseItem
<BinaryData>> ToSseEventsAsync(IAsyncEnumerable<OpenAI.Chat.StreamingChatCompletionUpdate> updates)
93
static void FormatAsSseEvent(
SseItem
<BinaryData> sseItem, IBufferWriter<byte> writer) =>
src\Shared\ServerSentEvents\SseFormatter.cs (6)
30
public static Task WriteAsync(IAsyncEnumerable<
SseItem
<string>> source, Stream destination, CancellationToken cancellationToken = default)
54
public static Task WriteAsync<T>(IAsyncEnumerable<
SseItem
<T>> source, Stream destination, Action<
SseItem
<T>, IBufferWriter<byte>> itemFormatter, CancellationToken cancellationToken = default)
74
private static async Task WriteAsyncCore<T>(IAsyncEnumerable<
SseItem
<T>> source, Stream destination, Action<
SseItem
<T>, IBufferWriter<byte>> itemFormatter, CancellationToken cancellationToken)
79
await foreach (
SseItem
<T> item in source.WithCancellation(cancellationToken).ConfigureAwait(false))
src\Shared\ServerSentEvents\SseItem.cs (1)
26
/// <summary>Initializes a new instance of the <see cref="
SseItem
{T}"/> struct.</summary>
src\Shared\ServerSentEvents\SseParser.cs (3)
15
/// <summary>The default <see cref="
SseItem
{T}.EventType"/> ("message") for an event that did not explicitly specify a type.</summary>
18
/// <summary>Creates a parser for parsing a <paramref name="sseStream"/> of server-sent events into a sequence of <see cref="
SseItem
{String}"/> values.</summary>
32
/// <summary>Creates a parser for parsing a <paramref name="sseStream"/> of server-sent events into a sequence of <see cref="
SseItem
{T}"/> values.</summary>
src\Shared\ServerSentEvents\SseParser_1.cs (5)
112
public IEnumerable<
SseItem
<T>> Enumerate()
147
if (ProcessLine(out
SseItem
<T> sseItem, out int advance))
192
public async IAsyncEnumerable<
SseItem
<T>> EnumerateAsync([EnumeratorCancellation] CancellationToken cancellationToken = default)
227
if (ProcessLine(out
SseItem
<T> sseItem, out int advance))
332
private bool ProcessLine(out
SseItem
<T> sseItem, out int advance)