Skip to content

Commit ab4a9ea

Browse files
authored
Update README.md
1 parent 11d6135 commit ab4a9ea

File tree

1 file changed

+44
-30
lines changed

1 file changed

+44
-30
lines changed

README.md

Lines changed: 44 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
# Code Interpreter SDK
22
E2B's [Code Interpreter SDK](https://github.com/e2b-dev/code-interpreter) allows you to add code interpreting capabilities to your AI apps.
33

4-
With code interpreting, you can build apps like:
5-
- AI code execution
6-
- Data analysis with AI
7-
- AI tutors
8-
- Reasoning modules for LLM
9-
104
The code interpreter runs inside the [E2B Sandbox](https://github.com/e2b-dev/e2b) - an open-source secure micro VM made for running untrusted AI-generated code and AI agents.
115
- ✅ Works with any LLM and AI framework
126
- ✅ Supports streaming content like charts and stdout, stderr
@@ -15,9 +9,51 @@ The code interpreter runs inside the [E2B Sandbox](https://github.com/e2b-dev/e2
159
- ✅ Runs AI-generated code in secure sandboxed environments
1610
- ✅ 100% open source (including [infrastructure](https://github.com/e2b-dev/infra))
1711

18-
Follow E2B on [X (Twitter)](https://twitter.com/e2b_dev)
12+
Follow E2B on [X (Twitter)](https://twitter.com/e2b_dev).
13+
14+
## 🚀 Quickstart
15+
16+
### 1. Install SDK
17+
18+
JavaScript
19+
```
20+
npm i @e2b/code-interpreter
21+
```
22+
23+
TypeScript
24+
```
25+
pip install e2b_code_interpreter
26+
```
27+
28+
### 2. Execute code with code interpreter inside sandbox
29+
30+
**JavaScript**
31+
```ts
32+
import { CodeInterpreter } from '@e2b/code-interpreter'
33+
34+
const sandbox = await CodeInterpreter.create()
35+
await sandbox.notebook.execCell('x = 1')
36+
37+
const execution = await sandbox.notebook.execCell('x+=1; x')
38+
console.log(execution.text) // outputs 2
39+
40+
await sandbox.close()
41+
```
42+
43+
**Python**
44+
```py
45+
from e2b_code_interpreter import CodeInterpreter
46+
47+
with CodeInterpreter() as sandbox:
48+
sandbox.notebook.exec_cell("x = 1")
49+
50+
execution = sandbox.notebook.exec_cell("x+=1; x")
51+
print(execution.text) # outputs 2
52+
```
53+
54+
### 3. Hello World guide
55+
Dive depeer and check out the [JavaScript](/hello-world/js) and [Python](/hello-world/py) the Hello World guides to learn how o connect code interpreter LLMs.
1956

20-
<img width="1200" alt="Post-02" src="https://github.com/e2b-dev/code-interpreter/assets/5136688/2fa8c371-f03c-4186-b0b6-4151e68b0539">
2157

2258
## 📖 Cookbook examples
2359

@@ -39,25 +75,3 @@ Follow E2B on [X (Twitter)](https://twitter.com/e2b_dev)
3975
- ✅ Python
4076
- (soon) JavaScript/TypeScript
4177

42-
## 🚀 Getting started
43-
44-
### 1. Get API key
45-
[Sign up](https://e2b.dev/docs/sign-in?view=sign-up) and [get your E2B API key](https://e2b.dev/docs/getting-started/api-key).
46-
47-
### 2. Install code interpreter SDK
48-
JavaScript
49-
```js
50-
npm i @e2b/code-interpreter
51-
```
52-
53-
Python
54-
```py
55-
pip install e2b_code_interpreter
56-
```
57-
58-
### 3. Check out Hello World example
59-
Check out the [TypeScript](https://github.com/e2b-dev/e2b-cookbook/tree/main/examples/hello-world-js) and [Python](https://github.com/e2b-dev/e2b-cookbook/tree/main/examples/hello-world-python) hello world examples.
60-
61-
### 4. Explore documentation
62-
Visit our docs at [e2b.dev/docs](https://e2b.dev/docs).
63-

0 commit comments

Comments
 (0)