11 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.OpenAI (5)
OpenAIModelMappers.StreamingChatCompletion.cs (5)
102(completionUpdate.AdditionalProperties ??= [])[nameof(chatCompletionUpdate.ContentTokenLogProbabilities)] = contentTokenLogProbs; 107(completionUpdate.AdditionalProperties ??= [])[nameof(chatCompletionUpdate.RefusalTokenLogProbabilities)] = refusalTokenLogProbs; 112(completionUpdate.AdditionalProperties ??= [])[nameof(chatCompletionUpdate.SystemFingerprint)] = fingerprint; 193(completionUpdate.AdditionalProperties ??= [])[nameof(ChatMessageContentPart.Refusal)] = refusal.ToString(); 199(completionUpdate.AdditionalProperties ??= [])[nameof(OpenAI.Chat.ChatCompletion.SystemFingerprint)] = fingerprint;
Microsoft.Extensions.AI.OpenAI.Tests (1)
OpenAISerializationTests.cs (1)
602AdditionalProperties = new()
Microsoft.Extensions.AI.Tests (1)
ChatCompletion\OpenTelemetryChatClientTests.cs (1)
91AdditionalProperties = new()
23 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 (4)
OpenAIModelMappers.StreamingChatCompletion.cs (4)
56refusalUpdate: chatCompletionUpdate.AdditionalProperties.GetValueOrDefault<string>(nameof(OpenAI.Chat.StreamingChatCompletionUpdate.RefusalUpdate)), 57contentTokenLogProbabilities: chatCompletionUpdate.AdditionalProperties.GetValueOrDefault<IReadOnlyList<ChatTokenLogProbabilityDetails>>(nameof(OpenAI.Chat.StreamingChatCompletionUpdate.ContentTokenLogProbabilities)), 58refusalTokenLogProbabilities: chatCompletionUpdate.AdditionalProperties.GetValueOrDefault<IReadOnlyList<ChatTokenLogProbabilityDetails>>(nameof(OpenAI.Chat.StreamingChatCompletionUpdate.RefusalTokenLogProbabilities)), 59systemFingerprint: chatCompletionUpdate.AdditionalProperties.GetValueOrDefault<string>(nameof(OpenAI.Chat.StreamingChatCompletionUpdate.SystemFingerprint)),
Microsoft.Extensions.AI.OpenAI.Tests (4)
OpenAIChatClientTests.cs (4)
274Assert.NotNull(updates[i].AdditionalProperties); 275Assert.Equal("fp_f85bea6784", updates[i].AdditionalProperties![nameof(OpenAI.Chat.ChatCompletion.SystemFingerprint)]); 865Assert.NotNull(updates[i].AdditionalProperties); 866Assert.Equal("fp_f85bea6784", updates[i].AdditionalProperties![nameof(OpenAI.Chat.ChatCompletion.SystemFingerprint)]);