Function: codeInterpreterTool()
@providerprotocol/ai / openai / codeInterpreterTool
Function: codeInterpreterTool()
Section titled “Function: 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.
Parameters
Section titled “Parameters”options?
Section titled “options?”Optional container configuration
container?
Section titled “container?”string | OpenAICodeInterpreterContainer
Returns
Section titled “Returns”A code interpreter tool configuration object
Example
Section titled “Example”// Default configurationconst interpreter = codeInterpreterTool();
// With custom container settingsconst customInterpreter = codeInterpreterTool({ container: { type: 'auto', memory_limit: '4g', file_ids: ['file_abc123'] }});