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

# Interface: IExecutor

Interface for executing AI provider operations

Executors abstract the execution mechanism, allowing providers to work
with either local API calls or remote server calls transparently.

Implementation patterns:

- LocalExecutor: Direct API calls using provider SDKs
- RemoteExecutor: HTTP/WebSocket calls to remote server
- CacheExecutor: Cached responses with fallback to another executor
- HybridExecutor: Conditional local/remote execution

## Implemented by

- [`AbstractExecutor`](../classes/AbstractExecutor)

## Table of contents

### Properties

- [name](IExecutor#name)
- [version](IExecutor#version)

### Methods

- [executeChat](IExecutor#executechat)
- [executeChatStream](IExecutor#executechatstream)
- [supportsTools](IExecutor#supportstools)
- [validateConfig](IExecutor#validateconfig)
- [dispose](IExecutor#dispose)

## Properties

### name

• `Readonly` **name**: `string`

Get executor name/identifier

#### Defined in

[packages/agents/src/interfaces/executor.ts:100](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/interfaces/executor.ts#L100)

---

### version

• `Readonly` **version**: `string`

Get executor version

#### Defined in

[packages/agents/src/interfaces/executor.ts:105](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/interfaces/executor.ts#L105)

## Methods

### executeChat

▸ **executeChat**(`request`): `Promise`\<[`IAssistantMessage`](IAssistantMessage)\>

Execute a chat completion request

#### Parameters

| Name      | Type                                             | Description                                              |
| :-------- | :----------------------------------------------- | :------------------------------------------------------- |
| `request` | [`IChatExecutionRequest`](IChatExecutionRequest) | Chat execution request with messages, options, and tools |

#### Returns

`Promise`\<[`IAssistantMessage`](IAssistantMessage)\>

Promise resolving to assistant message response

**`Example`**

```typescript
const response = await executor.executeChat({
  messages: [{ role: 'user', content: 'Hello!' }],
  options: { model: 'gpt-4', temperature: 0.7 },
  provider: 'openai',
  model: 'gpt-4',
});
```

#### Defined in

[packages/agents/src/interfaces/executor.ts:57](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/interfaces/executor.ts#L57)

---

### executeChatStream

▸ **executeChatStream**(`request`): `AsyncIterable`\<[`TUniversalMessage`](../modules#tuniversalmessage), `any`, `any`\>

Execute a streaming chat completion request

#### Parameters

| Name      | Type                                                 | Description                      |
| :-------- | :--------------------------------------------------- | :------------------------------- |
| `request` | [`IStreamExecutionRequest`](IStreamExecutionRequest) | Streaming chat execution request |

#### Returns

`AsyncIterable`\<[`TUniversalMessage`](../modules#tuniversalmessage), `any`, `any`\>

AsyncIterable of message chunks

**`Example`**

```typescript
for await (const chunk of executor.executeChatStream({
  messages: [{ role: 'user', content: 'Tell me a story' }],
  options: { model: 'gpt-4' },
  provider: 'openai',
  model: 'gpt-4',
  stream: true,
})) {
  console.log(chunk.content);
}
```

#### Defined in

[packages/agents/src/interfaces/executor.ts:78](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/interfaces/executor.ts#L78)

---

### supportsTools

▸ **supportsTools**(): `boolean`

Check if the executor supports tool calling

#### Returns

`boolean`

true if tool calling is supported

#### Defined in

[packages/agents/src/interfaces/executor.ts:84](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/interfaces/executor.ts#L84)

---

### validateConfig

▸ **validateConfig**(): `boolean`

Validate executor configuration

#### Returns

`boolean`

true if configuration is valid

#### Defined in

[packages/agents/src/interfaces/executor.ts:90](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/interfaces/executor.ts#L90)

---

### dispose

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

Clean up resources when executor is no longer needed

#### Returns

`Promise`\<`void`\>

#### Defined in

[packages/agents/src/interfaces/executor.ts:95](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/interfaces/executor.ts#L95)
