Skip to main content
The standard code-interpreter template includes Jupyter kernels for:
  • Python
  • JavaScript
  • TypeScript
  • R
  • Java
  • Bash
Pass language= when you run an isolated cell, or set the language on a code context when you want multiple cells to share kernel state.
result = sandbox.run_code("console.log(1 + 2)", language="javascript")
print("".join(result.logs.stdout))

ctx = sandbox.code_interpreter.create_code_context(language="r", cwd="/workspace")
sandbox.code_interpreter.run_code("x <- c(1, 2, 3)", context=ctx)
result = sandbox.code_interpreter.run_code("mean(x)", context=ctx)
print(result.results[0].text)