14 writes to AdditionalProperties
Microsoft.Extensions.AI.Abstractions (1)
ChatCompletion\ChatOptions.cs (1)
84AdditionalProperties = AdditionalProperties?.Clone(),
Microsoft.Extensions.AI.Abstractions.Tests (2)
ChatCompletion\ChatOptionsTests.cs (2)
80options.AdditionalProperties = additionalProps; 144options.AdditionalProperties = additionalProps;
Microsoft.Extensions.AI.AzureAIInference.Tests (1)
AzureAIInferenceChatClientTests.cs (1)
294AdditionalProperties = new()
Microsoft.Extensions.AI.Integration.Tests (1)
ChatClientIntegrationTests.cs (1)
117AdditionalProperties = new()
Microsoft.Extensions.AI.OpenAI (7)
OpenAIModelMapper.ChatCompletion.cs (7)
167(result.AdditionalProperties ??= [])[nameof(options.EndUserId)] = endUserId; 172(result.AdditionalProperties ??= [])[nameof(options.IncludeLogProbabilities)] = includeLogProbabilities; 177(result.AdditionalProperties ??= [])[nameof(options.LogitBiases)] = new Dictionary<int, int>(logitBiases); 182(result.AdditionalProperties ??= [])[nameof(options.AllowParallelToolCalls)] = allowParallelToolCalls; 187(result.AdditionalProperties ??= [])[nameof(options.TopLogProbabilityCount)] = topLogProbabilityCount; 192(result.AdditionalProperties ??= [])[nameof(options.Metadata)] = new Dictionary<string, string>(metadata); 197(result.AdditionalProperties ??= [])[nameof(options.StoredOutputEnabled)] = storedOutputEnabled;
Microsoft.Extensions.AI.OpenAI.Tests (1)
OpenAIChatClientTests.cs (1)
332AdditionalProperties = new()
Microsoft.Extensions.AI.Tests (1)
ChatCompletion\OpenTelemetryChatClientTests.cs (1)
130AdditionalProperties = new()
23 references to AdditionalProperties
Microsoft.Extensions.AI (1)
ChatCompletion\OpenTelemetryChatClient.cs (1)
293if (options.AdditionalProperties is { } props)
Microsoft.Extensions.AI.Abstractions (2)
ChatCompletion\ChatOptions.cs (2)
67/// <see cref="StopSequences"/>, and <see cref="AdditionalProperties"/>, are shallow-cloned, meaning a new collection instance is created, 84AdditionalProperties = AdditionalProperties?.Clone(),
Microsoft.Extensions.AI.Abstractions.Tests (7)
ChatCompletion\ChatOptionsTests.cs (7)
28Assert.Null(options.AdditionalProperties); 43Assert.Null(clone.AdditionalProperties); 94Assert.Same(additionalProps, options.AdditionalProperties); 109Assert.Equal(additionalProps, clone.AdditionalProperties); 165Assert.NotNull(deserialized.AdditionalProperties); 166Assert.Single(deserialized.AdditionalProperties); 167Assert.True(deserialized.AdditionalProperties.TryGetValue("key", out object? value));
Microsoft.Extensions.AI.AzureAIInference (1)
AzureAIInferenceChatClient.cs (1)
320if (options.AdditionalProperties is { } props)
Microsoft.Extensions.AI.Ollama (1)
OllamaChatClient.cs (1)
360if (options.AdditionalProperties?.TryGetValue(propertyName, out T? t) is true)
Microsoft.Extensions.AI.OpenAI (1)
OpenAIModelMapper.ChatCompletion.cs (1)
258if (options.AdditionalProperties is { Count: > 0 } additionalProperties)
Microsoft.Extensions.AI.OpenAI.Tests (10)
OpenAISerializationTests.cs (10)
43Assert.Null(request.Options.AdditionalProperties); 76Assert.Null(request.Options.AdditionalProperties); 141Assert.NotNull(request.Options.AdditionalProperties); 142Assert.Equal("user", request.Options.AdditionalProperties["EndUserId"]); 143Assert.True((bool)request.Options.AdditionalProperties["IncludeLogProbabilities"]!); 144Assert.Single((IDictionary<int, int>)request.Options.AdditionalProperties["LogitBiases"]!); 145Assert.True((bool)request.Options.AdditionalProperties["AllowParallelToolCalls"]!); 146Assert.Equal(42, request.Options.AdditionalProperties["TopLogProbabilityCount"]!); 147Assert.Single((IDictionary<string, string>)request.Options.AdditionalProperties["Metadata"]!); 148Assert.True((bool)request.Options.AdditionalProperties["StoredOutputEnabled"]!);