10 writes to AdditionalProperties
Microsoft.Extensions.AI.Abstractions (2)
ChatCompletion\ChatCompletion.cs (2)
119AdditionalProperties = AdditionalProperties 138AdditionalProperties = choice.AdditionalProperties,
Microsoft.Extensions.AI.Abstractions.Tests (2)
ChatCompletion\StreamingChatCompletionUpdateTests.cs (2)
66update.AdditionalProperties = props; 181AdditionalProperties = new() { ["key"] = "value" },
Microsoft.Extensions.AI.Ollama (1)
OllamaChatClient.cs (1)
156AdditionalProperties = ParseOllamaChatResponseProps(chunk),
Microsoft.Extensions.AI.OpenAI (5)
OpenAIChatClient.cs (5)
239(completionUpdate.AdditionalProperties ??= [])[nameof(chatCompletionUpdate.ContentTokenLogProbabilities)] = contentTokenLogProbs; 244(completionUpdate.AdditionalProperties ??= [])[nameof(chatCompletionUpdate.RefusalTokenLogProbabilities)] = refusalTokenLogProbs; 249(completionUpdate.AdditionalProperties ??= [])[nameof(chatCompletionUpdate.SystemFingerprint)] = fingerprint; 346(completionUpdate.AdditionalProperties ??= [])[nameof(ChatMessageContentPart.Refusal)] = refusal.ToString(); 352(completionUpdate.AdditionalProperties ??= [])[nameof(OpenAI.Chat.ChatCompletion.SystemFingerprint)] = fingerprint;
19 references to AdditionalProperties
Microsoft.Extensions.AI.Abstractions (3)
ChatCompletion\StreamingChatCompletionUpdateExtensions.cs (3)
114if (update.AdditionalProperties is not null) 118message.AdditionalProperties = new(update.AdditionalProperties); 122foreach (var entry in update.AdditionalProperties)
Microsoft.Extensions.AI.Abstractions.Tests (12)
ChatCompletion\ChatCompletionTests.cs (6)
230Assert.Equal("value1", update1.AdditionalProperties?["key1"]); 231Assert.Equal(42, update1.AdditionalProperties?["key2"]); 280Assert.Equal("choice1Value", update0.AdditionalProperties?["choice1Key"]); 290Assert.Equal("choice2Value", update1.AdditionalProperties?["choice2Key"]); 293Assert.Equal("value1", update2.AdditionalProperties?["key1"]); 294Assert.Equal(42, update2.AdditionalProperties?["key2"]);
ChatCompletion\StreamingChatCompletionUpdateTests.cs (6)
22Assert.Null(update.AdditionalProperties); 64Assert.Null(update.AdditionalProperties); 67Assert.Same(props, update.AdditionalProperties); 214Assert.NotNull(result.AdditionalProperties); 215Assert.Single(result.AdditionalProperties); 216Assert.True(result.AdditionalProperties.TryGetValue("key", out object? value));
Microsoft.Extensions.AI.OpenAI.Tests (4)
OpenAIChatClientTests.cs (4)
268Assert.NotNull(updates[i].AdditionalProperties); 269Assert.Equal("fp_f85bea6784", updates[i].AdditionalProperties![nameof(OpenAI.Chat.ChatCompletion.SystemFingerprint)]); 771Assert.NotNull(updates[i].AdditionalProperties); 772Assert.Equal("fp_f85bea6784", updates[i].AdditionalProperties![nameof(OpenAI.Chat.ChatCompletion.SystemFingerprint)]);