openai_code_interpreter_tool: OpenAI built-in code_interpreter tool

View source: R/openai_tools.R

openai_code_interpreter_toolR Documentation

OpenAI built-in code_interpreter tool

Description

Give the model an OpenAI-hosted Python sandbox.

Usage

openai_code_interpreter_tool(container = list(type = "auto"))

Arguments

container

Container spec. Defaults to list(type = "auto") which lets OpenAI provision an ephemeral container. Pass a string container ID (e.g. "cntr_abc123") to attach to a specific container, or a list for advanced config (e.g. list(type = "auto", memory_limit = "4g")).

Value

A plain list ready to drop into tools = list(...).

Examples

## Not run: 
generate_text(
  model,
  "Solve 3x + 11 = 14 step by step.",
  tools = list(openai_code_interpreter_tool())
)

## End(Not run)

aisdk documentation built on May 29, 2026, 9:07 a.m.