Giter Site home page Giter Site logo

danmarauda / code-interpreter Goto Github PK

View Code? Open in Web Editor NEW

This project forked from e2b-dev/code-interpreter

0.0 0.0 0.0 309 KB

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

Home Page: https://e2b.dev

License: Apache License 2.0

Shell 0.92% JavaScript 1.53% Python 69.87% TypeScript 26.99% Dockerfile 0.69%

code-interpreter's Introduction

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).

🚀 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 and Python the Hello World guides to learn how o connect code interpreter LLMs.

📖 Cookbook examples

Hello World

LLM Providers

AI Frameworks

💻 Supported languages for AI-code execution

  • ✅ Python
  • (soon) JavaScript/TypeScript

code-interpreter's People

Contributors

jakubno avatar mlejva avatar valentatomas avatar github-actions[bot] avatar im-calvin avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.