29 writes to Tools
Microsoft.Extensions.AI (2)
ChatCompletion\FunctionInvokingChatClient.cs (2)
280options.Tools = null; 386options.Tools = null;
Microsoft.Extensions.AI.Abstractions (1)
ChatCompletion\ChatOptions.cs (1)
94options.Tools = new List<AITool>(Tools);
Microsoft.Extensions.AI.Abstractions.Tests (2)
ChatCompletion\ChatOptionsTests.cs (2)
79options.Tools = tools; 139options.Tools =
Microsoft.Extensions.AI.AzureAIInference.Tests (2)
AzureAIInferenceChatClientTests.cs (2)
512Tools = [AIFunctionFactory.Create(([Description("The person whose age is being requested")] string personName) => 42, "GetPersonAge", "Gets the age of the specified person.")], 604Tools = [AIFunctionFactory.Create(([Description("The person whose age is being requested")] string personName) => 42, "GetPersonAge", "Gets the age of the specified person.")],
Microsoft.Extensions.AI.Integration.Tests (7)
ChatClientIntegrationTests.cs (6)
175Tools = [AIFunctionFactory.Create(() => secretNumber, "GetSecretNumber")] 198Tools = [AIFunctionFactory.Create((int a, int b) => a * b, "SecretComputation")] 214Tools = [AIFunctionFactory.Create((int a, int b) => a * b, "SecretComputation")] 242Tools = [AIFunctionFactory.Create((string personName) => 274Tools = [tool], 296Tools = [getSecretNumberTool, shieldsUpTool],
PromptBasedFunctionCallingChatClient.cs (1)
48options.Tools = null;
Microsoft.Extensions.AI.Ollama.Tests (3)
OllamaChatClientIntegrationTests.cs (2)
51Tools = [AIFunctionFactory.Create(() => secretNumber, "GetSecretNumber")], 86Tools = [stockPriceTool, irrelevantTool],
OllamaChatClientTests.cs (1)
367Tools = [AIFunctionFactory.Create(([Description("The person whose age is being requested")] string personName) => 42, "GetPersonAge", "Gets the age of the specified person.")],
Microsoft.Extensions.AI.OpenAI.Tests (2)
OpenAIChatClientTests.cs (2)
660Tools = [AIFunctionFactory.Create(([Description("The person whose age is being requested")] string personName) => 42, "GetPersonAge", "Gets the age of the specified person.")], 755Tools = [AIFunctionFactory.Create(([Description("The person whose age is being requested")] string personName) => 42, "GetPersonAge", "Gets the age of the specified person.")],
Microsoft.Extensions.AI.Tests (10)
ChatCompletion\FunctionInvokingChatClientTests.cs (10)
47Tools = 79Tools = 128Tools = 168Tools = 209Tools = 261Tools = 329Tools = 376ChatOptions options = new() { Tools = [func1, func2] }; 404Tools = [AIFunctionFactory.Create(() => "Result 1", "Func1")] 460Tools = [AIFunctionFactory.Create(() => "Result 1", "Func1")]
22 references to Tools
Microsoft.Extensions.AI (3)
ChatCompletion\FunctionInvokingChatClient.cs (3)
206|| options.Tools is not { Count: > 0 } 349|| options.Tools is not { Count: > 0 } 523AIFunction? function = options.Tools!.OfType<AIFunction>().FirstOrDefault(t => t.Metadata.Name == functionCallContent.Name);
Microsoft.Extensions.AI.Abstractions (6)
ChatCompletion\ChatOptions.cs (3)
66/// The clone will have the same values for all properties as the original instance. Any collections, like <see cref="Tools"/>, 92if (Tools is not null) 94options.Tools = new List<AITool>(Tools);
ChatCompletion\ChatToolMode.cs (3)
32/// <see cref="ChatOptions.Tools"/> can contain zero or more <see cref="AITool"/> 39/// but that any tool can be selected. At least one tool must be provided in <see cref="ChatOptions.Tools"/>. 46/// must match an entry in <see cref="ChatOptions.Tools"/>.
Microsoft.Extensions.AI.Abstractions.Tests (5)
ChatCompletion\ChatOptionsTests.cs (5)
27Assert.Null(options.Tools); 42Assert.Null(clone.Tools); 93Assert.Same(tools, options.Tools); 108Assert.Equal(tools, clone.Tools); 164Assert.Null(deserialized.Tools);
Microsoft.Extensions.AI.AzureAIInference (1)
AzureAIInferenceChatClient.cs (1)
337if (options.Tools is { Count: > 0 } tools)
Microsoft.Extensions.AI.Integration.Tests (2)
PromptBasedFunctionCallingChatClient.cs (2)
44if (options?.Tools is { Count: > 0 }) 46AddOrUpdateToolPrompt(chatMessages, options.Tools);
Microsoft.Extensions.AI.Ollama (2)
OllamaChatClient.cs (2)
115if (options?.Tools is { Count: > 0 }) 265Tools = options?.Tools is { Count: > 0 } tools ? tools.OfType<AIFunction>().Select(ToOllamaTool) : null,
Microsoft.Extensions.AI.Ollama.Tests (1)
OllamaChatClientIntegrationTests.cs (1)
101Assert.Null(options?.Tools);
Microsoft.Extensions.AI.OpenAI (2)
OpenAIChatClient.cs (2)
136if (options?.Tools is { Count: > 0 }) 451if (options.Tools is { Count: > 0 } tools)