# Class BuiltInCodeExecutor

A code executor that uses the Model's built-in code executor.

Currently only supports Gemini 2.0+ models, but will be expanded to other models.

#### Hierarchy (View Summary)

- BaseCodeExecutor
  - BuiltInCodeExecutor

- Defined in code_executors/built_in_code_executor.ts:42

## Constructors

### constructor

- new BuiltInCodeExecutor(): BuiltInCodeExecutor

  #### Returns BuiltInCodeExecutor

  Inherited from BaseCodeExecutor.constructor

## Properties

### `Readonly`[BASE_CODE_EXECUTOR_SIGNATURE_SYMBOL]

"[BASE_CODE_EXECUTOR_SIGNATURE_SYMBOL]": true

A unique symbol to identify BaseCodeExecutor class.

Inherited from BaseCodeExecutor.[BASE_CODE_EXECUTOR_SIGNATURE_SYMBOL]

- Defined in code_executors/base_code_executor.ts:52

### `Readonly`[BUILT_IN_CODE_EXECUTOR_SIGNATURE_SYMBOL]

"[BUILT_IN_CODE_EXECUTOR_SIGNATURE_SYMBOL]": true

A unique symbol to identify BuiltInCodeExecutor class.

- Defined in code_executors/built_in_code_executor.ts:44

### codeBlockDelimiters

codeBlockDelimiters: [string, string][] = ...

The list of the enclosing delimiters to identify the code blocks. For example, the delimiter('`python\\n', '\\n`') can be used to identify code blocks with the following format::

     print("hello")

Inherited from BaseCodeExecutor.codeBlockDelimiters

- Defined in code_executors/base_code_executor.ts:82

### errorRetryAttempts

errorRetryAttempts: number = 2

The number of attempts to retry on consecutive code execution errors. Default to 2.

Inherited from BaseCodeExecutor.errorRetryAttempts

- Defined in code_executors/base_code_executor.ts:71

### executionResultDelimiters

executionResultDelimiters: [string, string] = ...

The delimiters to format the code execution result.

Inherited from BaseCodeExecutor.executionResultDelimiters

- Defined in code_executors/base_code_executor.ts:90

### optimizeDataFile

optimizeDataFile: boolean = false

If true, extract and process data files from the model request and attach them to the code executor.

Supported data file MimeTypes are [text/csv]. Default to false.

Inherited from BaseCodeExecutor.optimizeDataFile

- Defined in code_executors/base_code_executor.ts:60

### stateful

stateful: boolean = false

Whether the code executor is stateful. Default to false.

Inherited from BaseCodeExecutor.stateful

- Defined in code_executors/base_code_executor.ts:65

## Methods

### executeCode

- executeCode(_params: ExecuteCodeParams): Promise<CodeExecutionResult>

  Executes code and return the code execution result.

  #### Parameters

  - _params: ExecuteCodeParams

  #### Returns Promise<CodeExecutionResult>

  The result of the code execution.

  Overrides BaseCodeExecutor.executeCode

  - Defined in code_executors/built_in_code_executor.ts:46

### processLlmRequest

- processLlmRequest(llmRequest: LlmRequest): void

  #### Parameters

  - llmRequest: LlmRequest

  #### Returns void

  - Defined in code_executors/built_in_code_executor.ts:54