4 instantiations of SseItem
Microsoft.Extensions.AI.OpenAI (4)
OpenAISerializationHelpers.cs (2)
87yield return new(binaryData); 90yield return new(_finalSseEvent);
src\Shared\ServerSentEvents\SseParser_1.cs (2)
344sseItem = new SseItem<T>(data, _eventType) { EventId = _eventId, ReconnectionInterval = _nextReconnectionInterval }; 398sseItem = new SseItem<T>(data, _eventType) { EventId = _eventId, ReconnectionInterval = _nextReconnectionInterval };
17 references to SseItem
Microsoft.Extensions.AI.OpenAI (17)
OpenAISerializationHelpers.cs (2)
82static async IAsyncEnumerable<SseItem<BinaryData>> ToSseEventsAsync(IAsyncEnumerable<OpenAI.Chat.StreamingChatCompletionUpdate> updates) 93static void FormatAsSseEvent(SseItem<BinaryData> sseItem, IBufferWriter<byte> writer) =>
src\Shared\ServerSentEvents\SseFormatter.cs (6)
30public static Task WriteAsync(IAsyncEnumerable<SseItem<string>> source, Stream destination, CancellationToken cancellationToken = default) 54public static Task WriteAsync<T>(IAsyncEnumerable<SseItem<T>> source, Stream destination, Action<SseItem<T>, IBufferWriter<byte>> itemFormatter, CancellationToken cancellationToken = default) 74private static async Task WriteAsyncCore<T>(IAsyncEnumerable<SseItem<T>> source, Stream destination, Action<SseItem<T>, IBufferWriter<byte>> itemFormatter, CancellationToken cancellationToken) 79await 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)
112public IEnumerable<SseItem<T>> Enumerate() 147if (ProcessLine(out SseItem<T> sseItem, out int advance)) 192public async IAsyncEnumerable<SseItem<T>> EnumerateAsync([EnumeratorCancellation] CancellationToken cancellationToken = default) 227if (ProcessLine(out SseItem<T> sseItem, out int advance)) 332private bool ProcessLine(out SseItem<T> sseItem, out int advance)