PromptAgentBuilderExtensions
Class static net8.0
Extension methods for adding Microsoft Foundry prompt agents and tools to the distributed application model.
namespace Aspire.Hosting;
public static class PromptAgentBuilderExtensions{ // ...} 19 members
Methods19
Section titled MethodsAddAISearchTool(IResourceBuilder<AzureCognitiveServicesProjectResource>, string, string?)extensionats exportIResourceBuilder<AzureAISearchToolResource> Adds an Azure AI Search tool to a Microsoft Foundry project, enabling agents to ground their responses using data from an Azure AI Search index.
AddAzureFunctionTool(IResourceBuilder<AzureCognitiveServicesProjectResource>, string, string, string, BinaryData, string, string, string, string)extensionats ignoredIResourceBuilder<AzureFunctionToolResource> Adds an Azure Function tool to a Microsoft Foundry project, enabling agents to invoke a serverless Azure Function with queue-based input/output bindings.
AddAzureFunctionTool(IResourceBuilder<AzureCognitiveServicesProjectResource>, string, string, string, string, string, string, string, string)extensionats exportIResourceBuilder<AzureFunctionToolResource> Adds an Azure Function tool to a Microsoft Foundry project, enabling agents to invoke a serverless Azure Function with queue-based input/output bindings.
AddBingGroundingTool(IResourceBuilder<AzureCognitiveServicesProjectResource>, string)extensionats exportIResourceBuilder<BingGroundingToolResource> Adds a Bing Grounding tool to a Microsoft Foundry project, enabling agents to ground their responses using Bing Search results.
AddCodeInterpreterTool(IResourceBuilder<AzureCognitiveServicesProjectResource>, string)extensionats exportIResourceBuilder<CodeInterpreterToolResource> Adds a Code Interpreter tool to a Microsoft Foundry project, enabling agents to write and run Python code in a sandboxed environment for data analysis, math, and chart generation.
AddComputerUseTool(IResourceBuilder<AzureCognitiveServicesProjectResource>, string, int, int, string)extensionats exportIResourceBuilder<ComputerToolResource> Adds a Computer Use tool to a Microsoft Foundry project, enabling agents to interact with a computer desktop by taking screenshots, moving the mouse, clicking, and typing.
AddFabricTool(IResourceBuilder<AzureCognitiveServicesProjectResource>, string, string[])extensionats exportIResourceBuilder<FabricToolResource> Adds a Microsoft Fabric data agent tool to a Microsoft Foundry project, enabling agents to query data through Fabric data agents.
AddFileSearchTool(IResourceBuilder<AzureCognitiveServicesProjectResource>, string, string[])extensionats exportIResourceBuilder<FileSearchToolResource> Adds a File Search tool to a Microsoft Foundry project, enabling agents to search uploaded files and proprietary documents using vector search.
AddFunctionTool(IResourceBuilder<AzureCognitiveServicesProjectResource>, string, string, BinaryData, string?, bool?)extensionats ignoredIResourceBuilder<FunctionToolResource> Adds a function calling tool to a Microsoft Foundry project, enabling agents to call application-defined functions with structured parameters.
AddImageGenerationTool(IResourceBuilder<AzureCognitiveServicesProjectResource>, string)extensionats exportIResourceBuilder<ImageGenerationToolResource> Adds an Image Generation tool to a Microsoft Foundry project, enabling agents to generate and edit images.
AddPromptAgent(IResourceBuilder<AzureCognitiveServicesProjectResource>, string, IResourceBuilder<FoundryDeploymentResource>, string?)extensionats exportIResourceBuilder<AzurePromptAgentResource> Adds a prompt agent to a Microsoft Foundry project with the specified tools.
AddSharePointTool(IResourceBuilder<AzureCognitiveServicesProjectResource>, string, string[])extensionats exportIResourceBuilder<SharePointToolResource> Adds a SharePoint grounding tool to a Microsoft Foundry project, enabling agents to search data from SharePoint sites configured as Foundry project connections.
AddWebSearchTool(IResourceBuilder<AzureCognitiveServicesProjectResource>, string)extensionats exportIResourceBuilder<WebSearchToolResource> Adds a Web Search tool to a Microsoft Foundry project, enabling agents to retrieve real-time information from the public web and return answers with inline citations.
WithCustomTool(IResourceBuilder<AzurePromptAgentResource>, IFoundryTool)extensionats ignoredIResourceBuilder<AzurePromptAgentResource> Adds a custom tool implementation to a prompt agent using the
IFoundryTool interface. WithReference(IResourceBuilder<AzureAISearchToolResource>, IResourceBuilder<AzureSearchResource>)extensionats exportIResourceBuilder<AzureAISearchToolResource> Links an Azure AI Search tool to a backing
Azure.AzureSearchResource, creating the necessary Foundry project connection and role assignments. WithReference(IResourceBuilder<BingGroundingToolResource>, IResourceBuilder<BingGroundingConnectionResource>)extensionats ignoredIResourceBuilder<BingGroundingToolResource> Links a Bing Grounding tool to a Foundry project connection for the Bing Search service.
WithReference(IResourceBuilder<BingGroundingToolResource>, string)extensionats ignoredIResourceBuilder<BingGroundingToolResource> Links a Bing Grounding tool to a Bing Search resource by using its Azure resource ID.
WithReference(IResourceBuilder<BingGroundingToolResource>, IResourceBuilder<ParameterResource>)extensionats ignoredIResourceBuilder<BingGroundingToolResource> Links a Bing Grounding tool to a Bing Search resource by using a parameter that contains its Azure resource ID.
WithTool(IResourceBuilder<AzurePromptAgentResource>, IResourceBuilder<FoundryToolResource>)extensionats exportIResourceBuilder<AzurePromptAgentResource> Adds a tool to a prompt agent.