20 references to TryGetValue
Microsoft.Extensions.AI.Abstractions.Tests (3)
AdditionalPropertiesDictionaryTests.cs (3)
78
Assert.True(d.
TryGetValue
("key", out T2? value));
81
Assert.False(d.
TryGetValue
("key2", out value));
89
Assert.False(d.
TryGetValue
("key", out T2? value));
Microsoft.Extensions.AI.Ollama (3)
OllamaChatClient.cs (1)
360
if (options.AdditionalProperties?.
TryGetValue
(propertyName, out T? t) is true)
OllamaEmbeddingGenerator.cs (2)
95
if (requestProps.
TryGetValue
("keep_alive", out long keepAlive))
100
if (requestProps.
TryGetValue
("truncate", out bool truncate))
Microsoft.Extensions.AI.OpenAI (14)
OpenAIEmbeddingGenerator.cs (1)
149
if (additionalProperties.
TryGetValue
(nameof(openAIOptions.EndUserId), out string? endUserId))
OpenAIModelMapper.ChatCompletion.cs (12)
260
if (additionalProperties.
TryGetValue
(nameof(result.EndUserId), out string? endUserId))
265
if (additionalProperties.
TryGetValue
(nameof(result.IncludeLogProbabilities), out bool includeLogProbabilities))
270
if (additionalProperties.
TryGetValue
(nameof(result.LogitBiases), out IDictionary<int, int>? logitBiases))
278
if (additionalProperties.
TryGetValue
(nameof(result.AllowParallelToolCalls), out bool allowParallelToolCalls))
283
if (additionalProperties.
TryGetValue
(nameof(result.TopLogProbabilityCount), out int topLogProbabilityCountInt))
288
if (additionalProperties.
TryGetValue
(nameof(result.Metadata), out IDictionary<string, string>? metadata))
296
if (additionalProperties.
TryGetValue
(nameof(result.StoredOutputEnabled), out bool storeOutputEnabled))
460
int? inputAudioTokenCount = additionalCounts.
TryGetValue
(
464
int? inputCachedTokenCount = additionalCounts.
TryGetValue
(
468
int? outputAudioTokenCount = additionalCounts.
TryGetValue
(
472
int? outputReasoningTokenCount = additionalCounts.
TryGetValue
(
585
dict?.
TryGetValue
(key, out T? value) is true ? value : default;
OpenAIModelMapper.ChatMessage.cs (1)
176
if (input.AdditionalProperties?.
TryGetValue
(nameof(message.Refusal), out string? refusal) is true)