agents / Exports / AgentTemplates
Class: AgentTemplates
Agent Templates implementation Manages agent templates for AgentFactory Instance-based for isolated template management
Table of contents
Constructors
Methods
- registerTemplate
- unregisterTemplate
- getTemplates
- getTemplate
- findTemplates
- applyTemplate
- hasTemplate
- getTemplateCount
- clearAll
- getStats
Constructors
constructor
• new AgentTemplates(): AgentTemplates
Returns
Defined in
packages/agents/src/managers/agent-templates.ts:42
Methods
registerTemplate
▸ registerTemplate(template): void
Register a template
Parameters
| Name | Type |
|---|---|
template | AgentTemplate |
Returns
void
Defined in
packages/agents/src/managers/agent-templates.ts:50
unregisterTemplate
▸ unregisterTemplate(templateId): boolean
Unregister a template
Parameters
| Name | Type |
|---|---|
templateId | string |
Returns
boolean
Defined in
packages/agents/src/managers/agent-templates.ts:70
getTemplates
▸ getTemplates(): AgentTemplate[]
Get all templates
Returns
Defined in
packages/agents/src/managers/agent-templates.ts:83
getTemplate
▸ getTemplate(templateId): undefined | AgentTemplate
Get template by ID
Parameters
| Name | Type |
|---|---|
templateId | string |
Returns
undefined | AgentTemplate
Defined in
packages/agents/src/managers/agent-templates.ts:90
findTemplates
▸ findTemplates(criteria): AgentTemplate[]
Find templates by criteria
Parameters
| Name | Type |
|---|---|
criteria | Object |
criteria.category? | string |
criteria.tags? | string[] |
criteria.provider? | string |
criteria.model? | string |
Returns
Defined in
packages/agents/src/managers/agent-templates.ts:97
applyTemplate
▸ applyTemplate(template, overrides?): TemplateApplicationResult
Apply template to configuration
Parameters
| Name | Type |
|---|---|
template | AgentTemplate |
overrides | Partial<AgentConfig> |
Returns
Defined in
packages/agents/src/managers/agent-templates.ts:136
hasTemplate
▸ hasTemplate(templateId): boolean
Check if template exists
Parameters
| Name | Type |
|---|---|
templateId | string |
Returns
boolean
Defined in
packages/agents/src/managers/agent-templates.ts:181
getTemplateCount
▸ getTemplateCount(): number
Get template count
Returns
number
Defined in
packages/agents/src/managers/agent-templates.ts:188
clearAll
▸ clearAll(): void
Clear all templates
Returns
void
Defined in
packages/agents/src/managers/agent-templates.ts:195
getStats
▸ getStats(): Object
Get template statistics
Returns
Object
| Name | Type |
|---|---|
totalTemplates | number |
categories | string[] |
tags | string[] |
providers | string[] |
models | string[] |