<!--
 ⚠️  AUTO-GENERATED FILE - DO NOT EDIT MANUALLY
 This file is automatically generated by scripts/docs-generator.js
 To make changes, edit the source TypeScript files or update the generator script
-->

[agents](../../) / [Exports](../modules) / AgentTemplates

# Class: AgentTemplates

Agent Templates implementation
Manages agent templates for AgentFactory
Instance-based for isolated template management

## Table of contents

### Constructors

- [constructor](AgentTemplates#constructor)

### Methods

- [registerTemplate](AgentTemplates#registertemplate)
- [unregisterTemplate](AgentTemplates#unregistertemplate)
- [getTemplates](AgentTemplates#gettemplates)
- [getTemplate](AgentTemplates#gettemplate)
- [findTemplates](AgentTemplates#findtemplates)
- [applyTemplate](AgentTemplates#applytemplate)
- [hasTemplate](AgentTemplates#hastemplate)
- [getTemplateCount](AgentTemplates#gettemplatecount)
- [clearAll](AgentTemplates#clearall)
- [getStats](AgentTemplates#getstats)

## Constructors

### constructor

• **new AgentTemplates**(): [`AgentTemplates`](AgentTemplates)

#### Returns

[`AgentTemplates`](AgentTemplates)

#### Defined in

[packages/agents/src/managers/agent-templates.ts:38](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/managers/agent-templates.ts#L38)

## Methods

### registerTemplate

▸ **registerTemplate**(`template`): `void`

Register a template

#### Parameters

| Name       | Type                                             |
| :--------- | :----------------------------------------------- |
| `template` | [`IAgentTemplate`](../interfaces/IAgentTemplate) |

#### Returns

`void`

#### Defined in

[packages/agents/src/managers/agent-templates.ts:46](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/managers/agent-templates.ts#L46)

---

### unregisterTemplate

▸ **unregisterTemplate**(`templateId`): `boolean`

Unregister a template

#### Parameters

| Name         | Type     |
| :----------- | :------- |
| `templateId` | `string` |

#### Returns

`boolean`

#### Defined in

[packages/agents/src/managers/agent-templates.ts:66](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/managers/agent-templates.ts#L66)

---

### getTemplates

▸ **getTemplates**(): [`IAgentTemplate`](../interfaces/IAgentTemplate)[]

Get all templates

#### Returns

[`IAgentTemplate`](../interfaces/IAgentTemplate)[]

#### Defined in

[packages/agents/src/managers/agent-templates.ts:79](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/managers/agent-templates.ts#L79)

---

### getTemplate

▸ **getTemplate**(`templateId`): `undefined` \| [`IAgentTemplate`](../interfaces/IAgentTemplate)

Get template by ID

#### Parameters

| Name         | Type     |
| :----------- | :------- |
| `templateId` | `string` |

#### Returns

`undefined` \| [`IAgentTemplate`](../interfaces/IAgentTemplate)

#### Defined in

[packages/agents/src/managers/agent-templates.ts:86](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/managers/agent-templates.ts#L86)

---

### findTemplates

▸ **findTemplates**(`criteria`): [`IAgentTemplate`](../interfaces/IAgentTemplate)[]

Find templates by criteria

#### Parameters

| Name                 | Type       |
| :------------------- | :--------- |
| `criteria`           | `Object`   |
| `criteria.category?` | `string`   |
| `criteria.tags?`     | `string`[] |
| `criteria.provider?` | `string`   |
| `criteria.model?`    | `string`   |

#### Returns

[`IAgentTemplate`](../interfaces/IAgentTemplate)[]

#### Defined in

[packages/agents/src/managers/agent-templates.ts:93](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/managers/agent-templates.ts#L93)

---

### applyTemplate

▸ **applyTemplate**(`template`, `overrides?`): [`ITemplateApplicationResult`](../interfaces/ITemplateApplicationResult)

Apply template to configuration

#### Parameters

| Name        | Type                                                      |
| :---------- | :-------------------------------------------------------- |
| `template`  | [`IAgentTemplate`](../interfaces/IAgentTemplate)          |
| `overrides` | `Partial`\<[`IAgentConfig`](../interfaces/IAgentConfig)\> |

#### Returns

[`ITemplateApplicationResult`](../interfaces/ITemplateApplicationResult)

#### Defined in

[packages/agents/src/managers/agent-templates.ts:132](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/managers/agent-templates.ts#L132)

---

### hasTemplate

▸ **hasTemplate**(`templateId`): `boolean`

Check if template exists

#### Parameters

| Name         | Type     |
| :----------- | :------- |
| `templateId` | `string` |

#### Returns

`boolean`

#### Defined in

[packages/agents/src/managers/agent-templates.ts:177](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/managers/agent-templates.ts#L177)

---

### getTemplateCount

▸ **getTemplateCount**(): `number`

Get template count

#### Returns

`number`

#### Defined in

[packages/agents/src/managers/agent-templates.ts:184](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/managers/agent-templates.ts#L184)

---

### clearAll

▸ **clearAll**(): `void`

Clear all templates

#### Returns

`void`

#### Defined in

[packages/agents/src/managers/agent-templates.ts:191](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/managers/agent-templates.ts#L191)

---

### getStats

▸ **getStats**(): `Object`

Get template statistics

#### Returns

`Object`

| Name             | Type       |
| :--------------- | :--------- |
| `totalTemplates` | `number`   |
| `categories`     | `string`[] |
| `tags`           | `string`[] |
| `providers`      | `string`[] |
| `models`         | `string`[] |

#### Defined in

[packages/agents/src/managers/agent-templates.ts:199](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/managers/agent-templates.ts#L199)
