Table of Contents

Class ClassifierAgentTemplate

Namespace
LMKit.Agents.Templates
Assembly
LM-Kit.NET.dll

A template for creating classification agents.

Classifier agents excel at categorizing content, detecting intent, routing requests, and performing sentiment analysis.

public sealed class ClassifierAgentTemplate : AgentTemplate
Inheritance
ClassifierAgentTemplate
Inherited Members

Examples

var agent = new ClassifierAgentTemplate()
    .WithModel(model)
    .WithCategories("billing", "technical", "sales", "general")
    .WithMultiLabel(false)
    .WithConfidenceThreshold(0.7)
    .Build();

var result = await agent.RunAsync("I can't log into my account and need help");

Properties

TemplateName

Gets the template name.

Methods

ConfigureBuilder(AgentBuilder)

Configures the agent builder with template-specific settings.

WithCategories(params string[])

Sets the categories for classification.

WithClassificationType(ClassificationType)

Sets the classification type.

WithConfidenceThreshold(double)

Sets the minimum confidence threshold.

WithCustomInstructions(string)

Sets custom classification instructions.

WithExplanation(bool)

Sets whether to include explanation for the classification.

WithModel(LM)

Sets the model for the agent.

WithMultiLabel(bool)

Sets whether multiple labels can be assigned (shorthand).

WithOutputFormat(ClassificationOutputFormat)

Sets the output format.

WithReturnScores(bool)

Sets whether to return confidence scores for all categories.