17 instantiations of StreamingChatCompletionUpdate
Microsoft.Extensions.AI (1)
ChatCompletion\CachingChatClient.cs (1)
136StreamingChatCompletionUpdate coalesced = new()
Microsoft.Extensions.AI.Abstractions.Tests (7)
ChatCompletion\ChatClientExtensionsTests.cs (1)
88return YieldAsync([new StreamingChatCompletionUpdate { Text = "world" }]);
ChatCompletion\StreamingChatCompletionUpdateTests.cs (6)
16StreamingChatCompletionUpdate update = new(); 33StreamingChatCompletionUpdate update = new(); 89StreamingChatCompletionUpdate update = new() 118StreamingChatCompletionUpdate update = new() 135StreamingChatCompletionUpdate update = new() 165StreamingChatCompletionUpdate original = new()
Microsoft.Extensions.AI.AzureAIInference (2)
AzureAIInferenceChatClient.cs (2)
170StreamingChatCompletionUpdate completionUpdate = new() 215var completionUpdate = new StreamingChatCompletionUpdate
Microsoft.Extensions.AI.Ollama (1)
OllamaChatClient.cs (1)
128StreamingChatCompletionUpdate update = new()
Microsoft.Extensions.AI.OpenAI (2)
OpenAIChatClient.cs (2)
212StreamingChatCompletionUpdate completionUpdate = new() 308StreamingChatCompletionUpdate completionUpdate = new()
Microsoft.Extensions.AI.Tests (4)
ChatCompletion\ConfigureOptionsChatClientTests.cs (1)
35var expectedUpdates = Enumerable.Range(0, 3).Select(i => new StreamingChatCompletionUpdate()).ToArray();
ChatCompletion\OpenTelemetryChatClientTests.cs (3)
65yield return new StreamingChatCompletionUpdate 73yield return new StreamingChatCompletionUpdate 78yield return new StreamingChatCompletionUpdate
82 references to StreamingChatCompletionUpdate
Microsoft.Extensions.AI (35)
ChatCompletion\CachingChatClient.cs (12)
62public override async IAsyncEnumerable<StreamingChatCompletionUpdate> CompleteStreamingAsync( 71foreach (var chunk in existingChunks) 79List<StreamingChatCompletionUpdate> capturedItems = []; 80await foreach (var chunk in base.CompleteStreamingAsync(chatMessages, options, cancellationToken).ConfigureAwait(false)) 95StreamingChatCompletionUpdate update = capturedItems[startInclusive]; 107StreamingChatCompletionUpdate next = capturedItems[endExclusive]; 136StreamingChatCompletionUpdate coalesced = new() 160StreamingChatCompletionUpdate next = capturedItems[i]; 211/// Returns a previously cached list of <see cref="StreamingChatCompletionUpdate"/> values, if available. 217protected abstract Task<IReadOnlyList<StreamingChatCompletionUpdate>?> ReadCacheStreamingAsync(string key, CancellationToken cancellationToken); 230/// Stores a list of <see cref="StreamingChatCompletionUpdate"/> values in the underlying cache. 237protected abstract Task WriteCacheStreamingAsync(string key, IReadOnlyList<StreamingChatCompletionUpdate> value, CancellationToken cancellationToken);
ChatCompletion\ConfigureOptionsChatClient.cs (2)
63public override async IAsyncEnumerable<StreamingChatCompletionUpdate> CompleteStreamingAsync( 66await foreach (var update in base.CompleteStreamingAsync(chatMessages, _configureOptions(options), cancellationToken).ConfigureAwait(false))
ChatCompletion\DistributedCachingChatClient.cs (5)
57protected override async Task<IReadOnlyList<StreamingChatCompletionUpdate>?> ReadCacheStreamingAsync(string key, CancellationToken cancellationToken) 64return (IReadOnlyList<StreamingChatCompletionUpdate>?)JsonSerializer.Deserialize(existingJson, _jsonSerializerOptions.GetTypeInfo(typeof(IReadOnlyList<StreamingChatCompletionUpdate>))); 82protected override async Task WriteCacheStreamingAsync(string key, IReadOnlyList<StreamingChatCompletionUpdate> value, CancellationToken cancellationToken) 88var newJson = JsonSerializer.SerializeToUtf8Bytes(value, _jsonSerializerOptions.GetTypeInfo(typeof(IReadOnlyList<StreamingChatCompletionUpdate>)));
ChatCompletion\FunctionInvokingChatClient.cs (2)
273public override async IAsyncEnumerable<StreamingChatCompletionUpdate> CompleteStreamingAsync( 284await foreach (var chunk in base.CompleteStreamingAsync(chatMessages, options, cancellationToken).ConfigureAwait(false))
ChatCompletion\LoggingChatClient.cs (3)
92public override async IAsyncEnumerable<StreamingChatCompletionUpdate> CompleteStreamingAsync( 107IAsyncEnumerator<StreamingChatCompletionUpdate> e; 125StreamingChatCompletionUpdate? update = null;
ChatCompletion\OpenTelemetryChatClient.cs (9)
140public override async IAsyncEnumerable<StreamingChatCompletionUpdate> CompleteStreamingAsync( 152IAsyncEnumerable<StreamingChatCompletionUpdate> updates; 164List<StreamingChatCompletionUpdate> trackedUpdates = []; 170StreamingChatCompletionUpdate update; 198/// <summary>Creates a <see cref="ChatCompletion"/> from a collection of <see cref="StreamingChatCompletionUpdate"/> instances.</summary> 204List<StreamingChatCompletionUpdate> updates) 207Dictionary<int, List<StreamingChatCompletionUpdate>> choices = []; 208foreach (var update in updates) 227foreach (var update in choice.Value)
Utilities\AIJsonUtilities.Defaults.cs (2)
59[JsonSerializable(typeof(StreamingChatCompletionUpdate))] 60[JsonSerializable(typeof(IReadOnlyList<StreamingChatCompletionUpdate>))]
Microsoft.Extensions.AI.Abstractions (4)
ChatCompletion\ChatClientExtensions.cs (1)
38public static IAsyncEnumerable<StreamingChatCompletionUpdate> CompleteStreamingAsync(
ChatCompletion\DelegatingChatClient.cs (1)
60public virtual IAsyncEnumerable<StreamingChatCompletionUpdate> CompleteStreamingAsync(IList<ChatMessage> chatMessages, ChatOptions? options = null, CancellationToken cancellationToken = default)
ChatCompletion\IChatClient.cs (1)
51IAsyncEnumerable<StreamingChatCompletionUpdate> CompleteStreamingAsync(
ChatCompletion\StreamingChatCompletionUpdate.cs (1)
72/// If a <see cref="StreamingChatCompletionUpdate"/> is created to represent some underlying object from another object
Microsoft.Extensions.AI.Abstractions.Tests (11)
ChatCompletion\DelegatingChatClientTests.cs (1)
68StreamingChatCompletionUpdate[] expectedResults =
ChatCompletion\StreamingChatCompletionUpdateTests.cs (7)
16StreamingChatCompletionUpdate update = new(); 33StreamingChatCompletionUpdate update = new(); 89StreamingChatCompletionUpdate update = new() 118StreamingChatCompletionUpdate update = new() 135StreamingChatCompletionUpdate update = new() 165StreamingChatCompletionUpdate original = new() 187StreamingChatCompletionUpdate? result = JsonSerializer.Deserialize(json, TestJsonSerializerContext.Default.StreamingChatCompletionUpdate);
TestChatClient.cs (2)
19public Func<IList<ChatMessage>, ChatOptions?, CancellationToken, IAsyncEnumerable<StreamingChatCompletionUpdate>>? CompleteStreamingAsyncCallback { get; set; } 26public IAsyncEnumerable<StreamingChatCompletionUpdate> CompleteStreamingAsync(IList<ChatMessage> chatMessages, ChatOptions? options = null, CancellationToken cancellationToken = default)
TestJsonSerializerContext.cs (1)
18[JsonSerializable(typeof(StreamingChatCompletionUpdate))]
Microsoft.Extensions.AI.AzureAIInference (3)
AzureAIInferenceChatClient.cs (3)
144public async IAsyncEnumerable<StreamingChatCompletionUpdate> CompleteStreamingAsync( 170StreamingChatCompletionUpdate completionUpdate = new() 215var completionUpdate = new StreamingChatCompletionUpdate
Microsoft.Extensions.AI.AzureAIInference.Tests (4)
AzureAIInferenceChatClientTests.cs (4)
186List<StreamingChatCompletionUpdate> updates = []; 187await foreach (var update in client.CompleteStreamingAsync("hello", new() 502List<StreamingChatCompletionUpdate> updates = []; 503await foreach (var update in client.CompleteStreamingAsync("How old is Alice?", new()
Microsoft.Extensions.AI.Integration.Tests (7)
CallCountingChatClient.cs (1)
26public override IAsyncEnumerable<StreamingChatCompletionUpdate> CompleteStreamingAsync(
ChatClientIntegrationTests.cs (4)
81await foreach (var chunk in _chatClient.CompleteStreamingAsync(chatHistory)) 114List<StreamingChatCompletionUpdate> chunks = []; 115await foreach (var chunk in response) 175await foreach (var chunk in response)
test\Libraries\Microsoft.Extensions.AI.Abstractions.Tests\TestChatClient.cs (2)
19public Func<IList<ChatMessage>, ChatOptions?, CancellationToken, IAsyncEnumerable<StreamingChatCompletionUpdate>>? CompleteStreamingAsyncCallback { get; set; } 26public IAsyncEnumerable<StreamingChatCompletionUpdate> CompleteStreamingAsync(IList<ChatMessage> chatMessages, ChatOptions? options = null, CancellationToken cancellationToken = default)
Microsoft.Extensions.AI.Ollama (2)
OllamaChatClient.cs (2)
90public async IAsyncEnumerable<StreamingChatCompletionUpdate> CompleteStreamingAsync( 128StreamingChatCompletionUpdate update = new()
Microsoft.Extensions.AI.Ollama.Tests (2)
OllamaChatClientTests.cs (2)
157List<StreamingChatCompletionUpdate> updates = []; 158await foreach (var update in client.CompleteStreamingAsync("hello", new()
Microsoft.Extensions.AI.OpenAI (3)
OpenAIChatClient.cs (3)
185public async IAsyncEnumerable<StreamingChatCompletionUpdate> CompleteStreamingAsync( 212StreamingChatCompletionUpdate completionUpdate = new() 308StreamingChatCompletionUpdate completionUpdate = new()
Microsoft.Extensions.AI.OpenAI.Tests (4)
OpenAIChatClientTests.cs (4)
232List<StreamingChatCompletionUpdate> updates = []; 233await foreach (var update in client.CompleteStreamingAsync("hello", new() 551List<StreamingChatCompletionUpdate> updates = []; 552await foreach (var update in client.CompleteStreamingAsync("How old is Alice?", new()
Microsoft.Extensions.AI.Tests (7)
ChatCompletion\ConfigureOptionsChatClientTests.cs (3)
76static async IAsyncEnumerable<StreamingChatCompletionUpdate> YieldUpdates(StreamingChatCompletionUpdate[] updates) 78foreach (var update in updates)
ChatCompletion\OpenTelemetryChatClientTests.cs (1)
57async static IAsyncEnumerable<StreamingChatCompletionUpdate> CallbackAsync(
test\Libraries\Microsoft.Extensions.AI.Abstractions.Tests\TestChatClient.cs (2)
19public Func<IList<ChatMessage>, ChatOptions?, CancellationToken, IAsyncEnumerable<StreamingChatCompletionUpdate>>? CompleteStreamingAsyncCallback { get; set; } 26public IAsyncEnumerable<StreamingChatCompletionUpdate> CompleteStreamingAsync(IList<ChatMessage> chatMessages, ChatOptions? options = null, CancellationToken cancellationToken = default)
TestJsonSerializerContext.cs (1)
15[JsonSerializable(typeof(IReadOnlyList<StreamingChatCompletionUpdate>))]