Skip to content

Python & JS/TS SDK for adding code interpreting to your AI app

License

Notifications You must be signed in to change notification settings

kazdatahelp/code-interpreter

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

172 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Code Interpreter SDK

E2B's Code Interpreter SDK allows you to add code interpreting capabilities to your AI apps.

The code interpreter runs inside the E2B Sandbox - an open-source secure sandbox made for running untrusted AI-generated code and AI agents.

  • ✅ Works with any LLM and AI framework
  • ✅ Supports streaming content like charts and stdout, stderr
  • ✅ Python & JS SDK
  • ✅ Runs on serverless and edge functions
  • ✅ Runs AI-generated code in secure sandboxed environments
  • ✅ 100% open source (including infrastructure)

Follow E2B on X (Twitter).

💻 Supported language runtimes

  • ✅ Python
  • (Beta) JavaScript, R, Java

📖 Documentation

🚀 Quickstart

1. Install SDK

JavaScript/TypeScript

npm i @e2b/code-interpreter

Python

pip install e2b_code_interpreter

2. Execute code with code interpreter inside sandbox

JavaScript

import { CodeInterpreter } from '@e2b/code-interpreter'

const sandbox = await CodeInterpreter.create()
await sandbox.notebook.execCell('x = 1')

const execution = await sandbox.notebook.execCell('x+=1; x')
console.log(execution.text)  // outputs 2

await sandbox.close()

Python

from e2b_code_interpreter import CodeInterpreter

with CodeInterpreter() as sandbox:
    sandbox.notebook.exec_cell("x = 1")

    execution = sandbox.notebook.exec_cell("x+=1; x")
    print(execution.text)  # outputs 2

3. Hello World guide

Dive depeer and check out the JavaScript/TypeScript and Python "Hello World" guides to learn how to connect code interpreter LLMs.

📖 Cookbook examples

Hello World

LLM Providers

AI Frameworks

About

Python & JS/TS SDK for adding code interpreting to your AI app

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 69.2%
  • TypeScript 27.4%
  • JavaScript 1.5%
  • Shell 1.2%
  • Dockerfile 0.7%