<!--
 ⚠️  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) / AbstractAgent

# Class: AbstractAgent\<TConfig, TContext, TMessage\>

## Type parameters

| Name       | Type                                                |
| :--------- | :-------------------------------------------------- |
| `TConfig`  | [`IAgentConfig`](../interfaces/IAgentConfig)        |
| `TContext` | [`IRunOptions`](../interfaces/IRunOptions)          |
| `TMessage` | [`TUniversalMessage`](../modules#tuniversalmessage) |

## Hierarchy

- **`AbstractAgent`**

  ↳ [`Robota`](Robota)

## Implements

- `IAgent`\<`TConfig`, `TContext`, `TMessage`\>

## Table of contents

### Constructors

- [constructor](AbstractAgent#constructor)

### Methods

- [configure](AbstractAgent#configure)
- [run](AbstractAgent#run)
- [runStream](AbstractAgent#runstream)
- [getHistory](AbstractAgent#gethistory)
- [clearHistory](AbstractAgent#clearhistory)
- [dispose](AbstractAgent#dispose)

## Constructors

### constructor

• **new AbstractAgent**\<`TConfig`, `TContext`, `TMessage`\>(): [`AbstractAgent`](AbstractAgent)\<`TConfig`, `TContext`, `TMessage`\>

#### Type parameters

| Name       | Type                                                |
| :--------- | :-------------------------------------------------- |
| `TConfig`  | [`IAgentConfig`](../interfaces/IAgentConfig)        |
| `TContext` | [`IRunOptions`](../interfaces/IRunOptions)          |
| `TMessage` | [`TUniversalMessage`](../modules#tuniversalmessage) |

#### Returns

[`AbstractAgent`](AbstractAgent)\<`TConfig`, `TContext`, `TMessage`\>

## Methods

### configure

▸ **configure**(`config`): `Promise`\<`void`\>

Configure the agent with type-safe configuration

#### Parameters

| Name     | Type      |
| :------- | :-------- |
| `config` | `TConfig` |

#### Returns

`Promise`\<`void`\>

#### Implementation of

IAgent.configure

#### Defined in

[packages/agents/src/abstracts/abstract-agent.ts:29](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/abstracts/abstract-agent.ts#L29)

---

### run

▸ **run**(`input`, `context?`): `Promise`\<`string`\>

Run agent with user input and type-safe context

#### Parameters

| Name       | Type       |
| :--------- | :--------- |
| `input`    | `string`   |
| `context?` | `TContext` |

#### Returns

`Promise`\<`string`\>

#### Implementation of

IAgent.run

#### Defined in

[packages/agents/src/abstracts/abstract-agent.ts:37](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/abstracts/abstract-agent.ts#L37)

---

### runStream

▸ **runStream**(`input`, `context?`): `AsyncGenerator`\<`string`, `void`, `never`\>

Run agent with streaming response and type-safe context

#### Parameters

| Name       | Type       |
| :--------- | :--------- |
| `input`    | `string`   |
| `context?` | `TContext` |

#### Returns

`AsyncGenerator`\<`string`, `void`, `never`\>

#### Implementation of

IAgent.runStream

#### Defined in

[packages/agents/src/abstracts/abstract-agent.ts:42](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/abstracts/abstract-agent.ts#L42)

---

### getHistory

▸ **getHistory**(): `TMessage`[]

Get conversation history with type-safe messages

#### Returns

`TMessage`[]

#### Implementation of

IAgent.getHistory

#### Defined in

[packages/agents/src/abstracts/abstract-agent.ts:47](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/abstracts/abstract-agent.ts#L47)

---

### clearHistory

▸ **clearHistory**(): `void`

Clear conversation history

#### Returns

`void`

#### Implementation of

IAgent.clearHistory

#### Defined in

[packages/agents/src/abstracts/abstract-agent.ts:54](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/abstracts/abstract-agent.ts#L54)

---

### dispose

▸ **dispose**(): `Promise`\<`void`\>

Cleanup resources

#### Returns

`Promise`\<`void`\>

#### Defined in

[packages/agents/src/abstracts/abstract-agent.ts:87](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/abstracts/abstract-agent.ts#L87)
