Class ExtractorAgentTemplate
A template for creating data extraction agents.
Extractor agents excel at extracting structured data from unstructured text, including entities, relationships, and schema-driven information.
public sealed class ExtractorAgentTemplate : AgentTemplate
- Inheritance
-
ExtractorAgentTemplate
- Inherited Members
Examples
var agent = new ExtractorAgentTemplate()
.WithModel(model)
.WithExtractionType(ExtractionType.Entities)
.WithSchema("name", "email", "phone", "company")
.WithOutputFormat(ExtractionFormat.Json)
.Build();
var result = await agent.RunAsync("Extract contact info from: John Smith from Acme Corp...");
Properties
- TemplateName
Gets the template name.
Methods
- ConfigureBuilder(AgentBuilder)
Configures the agent builder with template-specific settings.
- WithAllowInference(bool)
Sets whether to allow inference for missing data.
- WithEntityTypes(string)
Sets specific entity types to extract.
- WithExtractMultiple(bool)
Sets whether to extract multiple instances.
- WithExtractionType(ExtractionType)
Sets the type of extraction to perform.
- WithModel(LM)
Sets the model for the agent.
- WithOutputFormat(ExtractionFormat)
Sets the output format.
- WithSchema(params string[])
Sets the schema fields to extract.