Class CodeAgentTemplate
A template for creating code generation and analysis agents.
Code agents are optimized for writing, reviewing, explaining, and debugging code with best practices awareness.
public sealed class CodeAgentTemplate : AgentTemplate
- Inheritance
-
CodeAgentTemplate
- Inherited Members
Examples
var agent = new CodeAgentTemplate()
.WithModel(model)
.WithLanguages("C#", "Python")
.WithStyle(CodeStyle.Clean)
.Build();
var result = await agent.RunAsync("Write a function to sort a list");
Properties
- TemplateName
Gets the template name.
Methods
- ConfigureBuilder(AgentBuilder)
Configures the agent builder with template-specific settings.
- WithDocumentation(bool)
Sets whether to include documentation in generated code.
- WithLanguages(params string[])
Sets the preferred programming languages.
- WithModel(LM)
Sets the model for the agent.
- WithProjectContext(string)
Sets project-specific context.
- WithStyle(CodeStyle)
Sets the coding style preference.
- WithTests(bool)
Sets whether to include tests in code generation.