8 writes to AdditionalProperties
Microsoft.Extensions.AI.Abstractions (1)
ChatCompletion\StreamingChatCompletionUpdateExtensions.cs (1)
118message.AdditionalProperties = new(update.AdditionalProperties);
Microsoft.Extensions.AI.Abstractions.Tests (7)
ChatCompletion\ChatCompletionTests.cs (2)
246AdditionalProperties = new() { ["choice1Key"] = "choice1Value" }, 255AdditionalProperties = new() { ["choice2Key"] = "choice2Value" },
ChatCompletion\ChatMessageTests.cs (5)
245message.AdditionalProperties = props; 248message.AdditionalProperties = props; 251message.AdditionalProperties = null; 254message.AdditionalProperties = props; 297AdditionalProperties = new() { ["message-metadata-key-1"] = "message-metadata-value-1" },
24 references to AdditionalProperties
Microsoft.Extensions.AI.Abstractions (3)
ChatCompletion\ChatCompletion.cs (1)
138AdditionalProperties = choice.AdditionalProperties,
ChatCompletion\StreamingChatCompletionUpdateExtensions.cs (2)
116if (message.AdditionalProperties is null) 125_ = message.AdditionalProperties.TryAdd(entry.Key, entry.Value);
Microsoft.Extensions.AI.Abstractions.Tests (20)
ChatCompletion\ChatMessageTests.cs (10)
26Assert.Null(message.AdditionalProperties); 53Assert.Null(message.AdditionalProperties); 100Assert.Null(message.AdditionalProperties); 246Assert.Same(props, message.AdditionalProperties); 249Assert.Same(props, message.AdditionalProperties); 252Assert.Null(message.AdditionalProperties); 255Assert.Same(props, message.AdditionalProperties); 305Assert.NotNull(deserializedMessage.AdditionalProperties); 306Assert.Single(deserializedMessage.AdditionalProperties); 307Assert.Equal("message-metadata-value-1", deserializedMessage.AdditionalProperties["message-metadata-key-1"]?.ToString());
ChatCompletion\StreamingChatCompletionUpdateExtensionsTests.cs (10)
74Assert.NotNull(message.AdditionalProperties); 75Assert.Equal(2, message.AdditionalProperties.Count); 76Assert.Equal("b", message.AdditionalProperties["a"]); 77Assert.Equal("d", message.AdditionalProperties["c"]); 82Assert.NotNull(message.AdditionalProperties); 83Assert.Equal(3, message.AdditionalProperties.Count); 84Assert.Equal("h", message.AdditionalProperties["g"]); 85Assert.Equal("f", message.AdditionalProperties["e"]); 86Assert.Equal(42, message.AdditionalProperties["i"]); 91Assert.Null(message.AdditionalProperties);
Microsoft.Extensions.AI.OpenAI (1)
OpenAIChatClient.cs (1)
635if (input.AdditionalProperties?.TryGetValue(nameof(message.Refusal), out string? refusal) is true)