7 types derived from AITool
Microsoft.Extensions.AI.Abstractions (5)
Functions\AIFunctionDeclaration.cs (1)
16public abstract class AIFunctionDeclaration : AITool
Tools\HostedCodeInterpreterTool.cs (1)
13public class HostedCodeInterpreterTool : AITool
Tools\HostedFileSearchTool.cs (1)
13public class HostedFileSearchTool : AITool
Tools\HostedMcpServerTool.cs (1)
15public class HostedMcpServerTool : AITool
Tools\HostedWebSearchTool.cs (1)
11public class HostedWebSearchTool : AITool
Microsoft.Extensions.AI.Abstractions.Tests (1)
Tools\AIToolTests.cs (1)
43private sealed class DerivedAITool : AITool;
Microsoft.Extensions.AI.OpenAI (1)
OpenAIResponsesChatClient.cs (1)
896internal sealed class ResponseToolAITool(ResponseTool tool) : AITool
87 references to AITool
Microsoft.Extensions.AI (20)
ChatCompletion\FunctionInvokingChatClient.cs (20)
235public IList<AITool>? AdditionalTools { get; set; } 255/// <see cref="AITool"/>s that the <see cref="FunctionInvokingChatClient"/> is aware of (for example, because they're in 295(Dictionary<string, AITool>? toolMap, bool anyToolsRequireApproval) = CreateToolsMap(AdditionalTools, options?.Tools); // all available tools, indexed by name 427AITool[]? approvalRequiredFunctions = null; // available tools that require approval 435(Dictionary<string, AITool>? toolMap, bool anyToolsRequireApproval) = CreateToolsMap(AdditionalTools, options?.Tools); // all available tools, indexed by name 534(options?.Tools ?? Enumerable.Empty<AITool>()) 535.Concat(AdditionalTools ?? Enumerable.Empty<AITool>()) 725private static (Dictionary<string, AITool>? ToolMap, bool AnyRequireApproval) CreateToolsMap(params ReadOnlySpan<IList<AITool>?> toolLists) 727Dictionary<string, AITool>? map = null; 737AITool tool = toolList[i]; 814private bool ShouldTerminateLoopBasedOnHandleableFunctions(List<FunctionCallContent>? functionCalls, Dictionary<string, AITool>? toolMap) 834if (toolMap.TryGetValue(fcc.Name, out var tool)) 872Dictionary<string, AITool>? toolMap, List<FunctionCallContent> functionCallContents, int iteration, int consecutiveErrorCount, 1000Dictionary<string, AITool>? toolMap, List<FunctionCallContent> callContents, 1007!toolMap.TryGetValue(callContent.Name, out AITool? tool) || 1472AITool[] approvalRequiredFunctions, 1488foreach (var arf in approvalRequiredFunctions) 1531Dictionary<string, AITool> toolMap) 1604Dictionary<string, AITool>? toolMap,
Microsoft.Extensions.AI.Abstractions (12)
ChatCompletion\ChatOptions.cs (2)
116public IList<AITool>? Tools { get; set; } 176options.Tools = new List<AITool>(Tools);
ChatCompletion\ChatToolMode.cs (2)
33/// <see cref="ChatOptions.Tools"/> can contain zero or more <see cref="AITool"/> 42/// <see cref="ChatOptions.Tools"/> can contain zero or more <see cref="AITool"/>
Contents\CitationAnnotation.cs (1)
44/// This might be a function name, such as one from <see cref="AITool.Name"/>, or the name of a built-in tool
Functions\AIFunctionDeclaration.cs (1)
12/// adds the ability to invoke the function. Components can type test <see cref="AITool"/> instances
Functions\AIFunctionFactoryOptions.cs (1)
54/// Gets or sets additional values to store on the resulting <see cref="AITool.AdditionalProperties" /> property.
Tools\AITool.cs (5)
17/// <summary>Initializes a new instance of the <see cref="AITool"/> class.</summary> 34/// <summary>Asks the <see cref="AITool"/> for an object of the specified type <paramref name="serviceType"/>.</summary> 40/// The purpose of this method is to allow for the retrieval of strongly-typed services that might be provided by the <see cref="AITool"/>, 52/// <summary>Asks the <see cref="AITool"/> for an object of type <typeparamref name="TService"/>.</summary> 57/// The purpose of this method is to allow for the retrieval of strongly typed services that may be provided by the <see cref="AITool"/>,
Microsoft.Extensions.AI.Abstractions.Tests (4)
ChatCompletion\ChatOptionsTests.cs (1)
66List<AITool> tools =
Tools\AIToolTests.cs (3)
29Assert.Same(tool, tool.GetService(typeof(AITool))); 33Assert.Same(tool, tool.GetService<AITool>()); 39Assert.Null(tool.GetService<AITool>("key"));
Microsoft.Extensions.AI.AzureAIInference (1)
AzureAIInferenceChatClient.cs (1)
336foreach (AITool tool in tools)
Microsoft.Extensions.AI.Evaluation.Quality (25)
AIToolExtensions.cs (1)
15this IEnumerable<AITool> toolDefinitions,
IntentResolutionEvaluator.cs (1)
28/// defined as <see cref="AIFunctionDeclaration"/>s. Any other <see cref="AITool"/> definitions that are supplied via
IntentResolutionEvaluatorContext.cs (7)
22/// defined as <see cref="AIFunctionDeclaration"/>s. Any other <see cref="AITool"/> definitions that are supplied via 39/// are defined as <see cref="AIFunctionDeclaration"/>s. Any other <see cref="AITool"/> definitions will be ignored. 42public IntentResolutionEvaluatorContext(params AITool[] toolDefinitions) 58/// are defined as <see cref="AIFunctionDeclaration"/>s. Any other <see cref="AITool"/> definitions will be ignored. 61public IntentResolutionEvaluatorContext(IEnumerable<AITool> toolDefinitions) 84/// are defined as <see cref="AIFunctionDeclaration"/>s. Any other <see cref="AITool"/> definitions that are supplied via 88public IReadOnlyList<AITool> ToolDefinitions { get; }
TaskAdherenceEvaluator.cs (1)
27/// defined as <see cref="AIFunctionDeclaration"/>s. Any other <see cref="AITool"/> definitions that are supplied via
TaskAdherenceEvaluatorContext.cs (7)
23/// defined as <see cref="AIFunctionDeclaration"/>s. Any other <see cref="AITool"/> definitions that are supplied via 40/// are defined as <see cref="AIFunctionDeclaration"/>s. Any other <see cref="AITool"/> definitions will be ignored. 43public TaskAdherenceEvaluatorContext(params AITool[] toolDefinitions) 59/// are defined as <see cref="AIFunctionDeclaration"/>s. Any other <see cref="AITool"/> definitions will be ignored. 62public TaskAdherenceEvaluatorContext(IEnumerable<AITool> toolDefinitions) 86/// defined as <see cref="AIFunctionDeclaration"/>s. Any other <see cref="AITool"/> definitions that are supplied via 90public IReadOnlyList<AITool> ToolDefinitions { get; }
ToolCallAccuracyEvaluator.cs (1)
28/// defined as <see cref="AIFunctionDeclaration"/>s. Any other <see cref="AITool"/> definitions that are supplied via
ToolCallAccuracyEvaluatorContext.cs (7)
24/// defined as <see cref="AIFunctionDeclaration"/>s. Any other <see cref="AITool"/> definitions that are supplied via 41/// are defined as <see cref="AIFunctionDeclaration"/>s. Any other <see cref="AITool"/> definitions will be ignored. 44public ToolCallAccuracyEvaluatorContext(params AITool[] toolDefinitions) 60/// are defined as <see cref="AIFunctionDeclaration"/>s. Any other <see cref="AITool"/> definitions will be ignored. 63public ToolCallAccuracyEvaluatorContext(IEnumerable<AITool> toolDefinitions) 88/// are defined as <see cref="AIFunctionDeclaration"/>s. Any other <see cref="AITool"/> definitions that are supplied via 92public IReadOnlyList<AITool> ToolDefinitions { get; }
Microsoft.Extensions.AI.Integration.Tests (1)
PromptBasedFunctionCallingChatClient.cs (1)
167private static ChatMessage CreateToolPrompt(IList<AITool> tools)
Microsoft.Extensions.AI.OpenAI (15)
MicrosoftExtensionsAIResponsesExtensions.cs (11)
97/// <summary>Adds the <see cref="ResponseTool"/> to the list of <see cref="AITool"/>s.</summary> 98/// <param name="tools">The list of <see cref="AITool"/>s to which the provided tool should be added.</param> 101/// <see cref="ResponseTool"/> does not derive from <see cref="AITool"/>, so it cannot be added directly to a list of <see cref="AITool"/>s. 102/// Instead, this method wraps the provided <see cref="ResponseTool"/> in an <see cref="AITool"/> and adds that to the list. 106public static void Add(this IList<AITool> tools, ResponseTool tool) 113/// <summary>Creates an <see cref="AITool"/> to represent a raw <see cref="ResponseTool"/>.</summary> 114/// <param name="tool">The tool to wrap as an <see cref="AITool"/>.</param> 115/// <returns>The <paramref name="tool"/> wrapped as an <see cref="AITool"/>.</returns> 123/// When a tool has a corresponding <see cref="AITool"/>-derived type already defined in Microsoft.Extensions.AI, 132public static AITool AsAITool(this ResponseTool tool)
OpenAIAssistantsChatClient.cs (1)
332foreach (AITool tool in tools)
OpenAIChatClient.cs (1)
582foreach (AITool tool in tools)
OpenAIResponsesChatClient.cs (2)
426foreach (AITool tool in tools) 895/// <summary>Provides an <see cref="AITool"/> wrapper for a <see cref="ResponseTool"/>.</summary>
Microsoft.Extensions.AI.OpenAI.Tests (4)
OpenAIConversionTests.cs (3)
1185Assert.Throws<ArgumentNullException>("tools", () => ((IList<AITool>)null!).Add(ResponseTool.CreateWebSearchTool())); 1186Assert.Throws<ArgumentNullException>("tool", () => new List<AITool>().Add((ResponseTool)null!)); 1194Tools = new List<AITool> { ResponseTool.CreateWebSearchTool() },
OpenAIResponseClientTests.cs (1)
1036AITool mcpTool = rawTool ?
Microsoft.Extensions.AI.Tests (5)
ChatCompletion\FunctionInvokingChatClientApprovalsTests.cs (4)
21AITool[] tools = 101AITool[] additionalTools = 791AITool[]? additionalTools = null) 861AITool[]? additionalTools = null)
ChatCompletion\FunctionInvokingChatClientTests.cs (1)
72IList<AITool> additionalTools = [AIFunctionFactory.Create(() => "Additional Tool")];