19 references to TryGetValue
Microsoft.Extensions.AI.Abstractions.Tests (3)
AdditionalPropertiesDictionaryTests.cs (3)
78Assert.True(d.TryGetValue("key", out T2? value)); 81Assert.False(d.TryGetValue("key2", out value)); 89Assert.False(d.TryGetValue("key", out T2? value));
Microsoft.Extensions.AI.Ollama (3)
OllamaChatClient.cs (1)
390if (options.AdditionalProperties?.TryGetValue(propertyName, out T? t) is true)
OllamaEmbeddingGenerator.cs (2)
101if (requestProps.TryGetValue("keep_alive", out long keepAlive)) 106if (requestProps.TryGetValue("truncate", out bool truncate))
Microsoft.Extensions.AI.OpenAI (13)
OpenAIEmbeddingGenerator.cs (1)
119if (additionalProperties.TryGetValue(nameof(openAIOptions.EndUserId), out string? endUserId))
OpenAIResponseChatClient.cs (6)
334if (additionalProperties.TryGetValue(nameof(result.EndUserId), out string? endUserId)) 339if (additionalProperties.TryGetValue(nameof(result.Instructions), out string? instructions)) 344if (additionalProperties.TryGetValue(nameof(result.Metadata), out IDictionary<string, string>? metadata)) 352if (additionalProperties.TryGetValue(nameof(result.ReasoningOptions), out ResponseReasoningOptions? reasoningOptions)) 357if (additionalProperties.TryGetValue(nameof(result.StoredOutputEnabled), out bool storeOutputEnabled)) 362if (additionalProperties.TryGetValue(nameof(result.TruncationMode), out ResponseTruncationMode truncationMode))
OpenAISpeechToTextClient.cs (6)
195if (additionalProperties.TryGetValue(nameof(result.Temperature), out float? temperature)) 205if (additionalProperties.TryGetValue(nameof(result.ResponseFormat), out AudioTranscriptionFormat? responseFormat)) 210if (additionalProperties.TryGetValue(nameof(result.Prompt), out string? prompt)) 258if (additionalProperties.TryGetValue(nameof(result.Temperature), out float? temperature)) 263if (additionalProperties.TryGetValue(nameof(result.ResponseFormat), out AudioTranslationFormat? responseFormat)) 268if (additionalProperties.TryGetValue(nameof(result.Prompt), out string? prompt))