Skip to content

Function: codeInterpreterTool()

@providerprotocol/ai


@providerprotocol/ai / openai / codeInterpreterTool

codeInterpreterTool(options?): OpenAICodeInterpreterTool

Defined in: src/providers/openai/types.ts:1417

Creates a code interpreter tool configuration for the Responses API.

The code interpreter tool allows the model to write and execute Python code in a sandboxed environment.

Optional container configuration

string | OpenAICodeInterpreterContainer

OpenAICodeInterpreterTool

A code interpreter tool configuration object

// Default configuration
const interpreter = codeInterpreterTool();
// With custom container settings
const customInterpreter = codeInterpreterTool({
container: {
type: 'auto',
memory_limit: '4g',
file_ids: ['file_abc123']
}
});