27 writes to Tools
Microsoft.Extensions.AI (2)
ChatCompletion\FunctionInvokingChatClient.cs (2)
255options.Tools = null; 336options.Tools = null;
Microsoft.Extensions.AI.Abstractions (1)
ChatCompletion\ChatOptions.cs (1)
89options.Tools = new List<AITool>(Tools);
Microsoft.Extensions.AI.Abstractions.Tests (2)
ChatCompletion\ChatOptionsTests.cs (2)
73options.Tools = tools; 127options.Tools =
Microsoft.Extensions.AI.AzureAIInference.Tests (2)
AzureAIInferenceChatClientTests.cs (2)
413Tools = [AIFunctionFactory.Create(([Description("The person whose age is being requested")] string personName) => 42, "GetPersonAge", "Gets the age of the specified person.")], 505Tools = [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)
139Tools = [AIFunctionFactory.Create(() => secretNumber, "GetSecretNumber")] 155Tools = [AIFunctionFactory.Create((int a, int b) => a * b, "SecretComputation")] 171Tools = [AIFunctionFactory.Create((int a, int b) => a * b, "SecretComputation")] 199Tools = [AIFunctionFactory.Create((string personName) => 231Tools = [tool], 253Tools = [getSecretNumberTool, shieldsUpTool],
PromptBasedFunctionCallingChatClient.cs (1)
48options.Tools = null;
Microsoft.Extensions.AI.Ollama.Tests (3)
OllamaChatClientIntegrationTests.cs (2)
48Tools = [AIFunctionFactory.Create(() => secretNumber, "GetSecretNumber")], 82Tools = [stockPriceTool, irrelevantTool],
OllamaChatClientTests.cs (1)
352Tools = [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)
459Tools = [AIFunctionFactory.Create(([Description("The person whose age is being requested")] string personName) => 42, "GetPersonAge", "Gets the age of the specified person.")], 554Tools = [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 (8)
ChatCompletion\FunctionInvokingChatClientTests.cs (8)
33Tools = [ 59Tools = [ 93Tools = [ 123Tools = [ 156Tools = 204Tools = 253Tools = 291() => service.CompleteAsync(chat, new ChatOptions { Tools = [func1, func2] }));
22 references to Tools
Microsoft.Extensions.AI (3)
ChatCompletion\FunctionInvokingChatClient.cs (3)
188|| options.Tools is not { Count: > 0 } 299|| options.Tools is not { Count: > 0 } 463AIFunction? function = options.Tools!.OfType<AIFunction>().FirstOrDefault(t => t.Metadata.Name == functionCallContent.Name);
Microsoft.Extensions.AI.Abstractions (6)
ChatCompletion\ChatOptions.cs (3)
63/// The clone will have the same values for all properties as the original instance. Any collections, like <see cref="Tools"/>, 87if (Tools is not null) 89options.Tools = new List<AITool>(Tools);
ChatCompletion\ChatToolMode.cs (3)
32/// <see cref="ChatOptions.Tools"/> may contain zero or more <see cref="AITool"/> 39/// but that any tool may 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)
25Assert.Null(options.Tools); 38Assert.Null(clone.Tools); 85Assert.Same(tools, options.Tools); 98Assert.Equal(tools, clone.Tools); 150Assert.Null(deserialized.Tools);
Microsoft.Extensions.AI.AzureAIInference (1)
AzureAIInferenceChatClient.cs (1)
328if (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)
95if (options?.Tools is { Count: > 0 }) 237Tools = options?.Tools is { Count: > 0 } tools ? tools.OfType<AIFunction>().Select(ToOllamaTool) : null,
Microsoft.Extensions.AI.Ollama.Tests (1)
OllamaChatClientIntegrationTests.cs (1)
97Assert.Null(options?.Tools);
Microsoft.Extensions.AI.OpenAI (2)
OpenAIChatClient.cs (2)
121if (options?.Tools is { Count: > 0 }) 445if (options.Tools is { Count: > 0 } tools)