Skip to content

Commit 8fc98fb

Browse files
committed
Fix code snippets
1 parent 2de8cde commit 8fc98fb

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -83,34 +83,34 @@ pip install e2b
8383

8484
**JavaScript**
8585
```ts
86-
import { CodeInterpreter } from '@e2b/code-interpreter'
86+
import { Sandbox } from '@e2b/code-interpreter'
8787

88-
const sandbox = await CodeInterpreter.create()
89-
await sandbox.notebook.execCell('x = 1')
88+
const sandbox = await Sandbox.create()
89+
await sbx.runCode()('x = 1')
9090

91-
const execution = await sandbox.notebook.execCell('x+=1; x')
91+
const execution = await sbx.runCode()('x+=1; x')
9292
console.log(execution.text) // outputs 2
9393

9494
await sandbox.close()
9595
```
9696

9797
**Python**
9898
```py
99-
from e2b_code_interpreter import CodeInterpreter
99+
from e2b_code_interpreter import Sandbox
100100

101-
with CodeInterpreter() as sandbox:
102-
sandbox.notebook.exec_cell("x = 1")
101+
with Sandbox() as sandbox:
102+
sandbox.run_code()("x = 1")
103103

104-
execution = sandbox.notebook.exec_cell("x+=1; x")
104+
execution = sandbox.run_code()("x+=1; x")
105105
print(execution.text) # outputs 2
106106
```
107107

108108
### 3. More resources
109-
> Check out the [JavaScript/TypeScript](https://e2b.dev/docs/hello-world/js) and [Python](https://e2b.dev/docs/hello-world/py) "Hello World" guides to learn how to use our SDK.
109+
- Check out the [JavaScript/TypeScript](https://e2b.dev/docs/hello-world/js) and [Python](https://e2b.dev/docs/hello-world/py) "Hello World" guides to learn how to use our SDK.
110110

111-
> See [E2B documentation](https://e2b.dev/docs) to get started.
111+
- See [E2B documentation](https://e2b.dev/docs) to get started.
112112

113-
> Visit our [Cookbook](https://github.com/e2b-dev/e2b-cookbook/tree/main) to get inspired by examples with different LLMs and AI frameworks.
113+
- Visit our [Cookbook](https://github.com/e2b-dev/e2b-cookbook/tree/main) to get inspired by examples with different LLMs and AI frameworks.
114114

115115

116116
## Repository Structure

0 commit comments

Comments
 (0)