<!--
 ⚠️  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
-->

[playground](../../) / [Exports](../modules) / CodeExecutor

# Class: CodeExecutor

## Table of contents

### Constructors

- [constructor](CodeExecutor#constructor)

### Methods

- [executeCode](CodeExecutor#executecode)
- [sendMessage](CodeExecutor#sendmessage)
- [getContext](CodeExecutor#getcontext)
- [reset](CodeExecutor#reset)

## Constructors

### constructor

• **new CodeExecutor**(`config?`): [`CodeExecutor`](CodeExecutor)

#### Parameters

| Name      | Type                                                                |
| :-------- | :------------------------------------------------------------------ |
| `config?` | `Partial`\<[`IPlaygroundConfig`](../interfaces/IPlaygroundConfig)\> |

#### Returns

[`CodeExecutor`](CodeExecutor)

#### Defined in

[playground/src/lib/playground/code-executor.ts:50](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/playground/src/lib/playground/code-executor.ts#L50)

## Methods

### executeCode

▸ **executeCode**(`code`, `provider`): `Promise`\<[`IExecutionResult`](../interfaces/IExecutionResult)\>

#### Parameters

| Name       | Type     |
| :--------- | :------- |
| `code`     | `string` |
| `provider` | `string` |

#### Returns

`Promise`\<[`IExecutionResult`](../interfaces/IExecutionResult)\>

#### Defined in

[playground/src/lib/playground/code-executor.ts:64](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/playground/src/lib/playground/code-executor.ts#L64)

---

### sendMessage

▸ **sendMessage**(`message`): `Promise`\<`string`\>

#### Parameters

| Name      | Type     |
| :-------- | :------- |
| `message` | `string` |

#### Returns

`Promise`\<`string`\>

#### Defined in

[playground/src/lib/playground/code-executor.ts:239](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/playground/src/lib/playground/code-executor.ts#L239)

---

### getContext

▸ **getContext**(): `null` \| [`IAgentContext`](../interfaces/IAgentContext)

#### Returns

`null` \| [`IAgentContext`](../interfaces/IAgentContext)

#### Defined in

[playground/src/lib/playground/code-executor.ts:749](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/playground/src/lib/playground/code-executor.ts#L749)

---

### reset

▸ **reset**(): `void`

#### Returns

`void`

#### Defined in

[playground/src/lib/playground/code-executor.ts:753](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/playground/src/lib/playground/code-executor.ts#L753)
