Class ToolAgentTemplate
A template for creating agents optimized for tool usage.
Tool agents are designed to effectively leverage available tools to accomplish tasks, with configurable tool selection strategies.
public sealed class ToolAgentTemplate : AgentTemplate
- Inheritance
-
ToolAgentTemplate
- Inherited Members
Examples
var agent = new ToolAgentTemplate()
.WithModel(model)
.WithTools(searchTool, calculatorTool, emailTool)
.WithToolStrategy(ToolStrategy.Selective)
.Build();
var result = await agent.RunAsync("Search for recent news and send a summary email");
Properties
- TemplateName
Gets the template name.
Methods
- ConfigureBuilder(AgentBuilder)
Configures the agent builder with template-specific settings.
- WithConfirmation(bool)
Requires confirmation before executing potentially impactful tools.
- WithModel(LM)
Sets the model for the agent.
- WithParallelTools(bool)
Enables parallel tool execution when possible.
- WithTool(ITool)
Adds a single tool.
- WithToolStrategy(ToolStrategy)
Sets the tool selection strategy.
- WithTools(params ITool[])
Adds tools for the agent to use.