Class QAAgentTemplate
A template for creating question-answering agents.
QA agents excel at answering questions from provided context, documents, or knowledge bases with accurate citations.
public sealed class QAAgentTemplate : AgentTemplate
- Inheritance
-
QAAgentTemplate
- Inherited Members
Examples
var agent = new QAAgentTemplate()
.WithModel(model)
.WithAnswerStyle(AnswerStyle.Detailed)
.WithCitations(true)
.WithConfidenceIndicator(true)
.Build();
var result = await agent.RunAsync("Based on the document, what are the main requirements?");
Properties
- TemplateName
Gets the template name.
Methods
- ConfigureBuilder(AgentBuilder)
Configures the agent builder with template-specific settings.
- WithAllowInference(bool)
Sets whether to allow inference beyond explicit context.
- WithAnswerStyle(AnswerStyle)
Sets the answer style.
- WithCitations(bool)
Sets whether to include citations.
- WithConfidenceIndicator(bool)
Sets whether to show confidence level.
- WithDomain(string)
Sets the knowledge domain.
- WithHandleUnanswerable(bool)
Sets whether to gracefully handle unanswerable questions.
- WithModel(LM)
Sets the model for the agent.
- WithOutputFormat(QAOutputFormat)
Sets the output format.