@@ -42,7 +42,7 @@ You can create a snapshot from a running sandbox instance.
4242
4343<CodeGroup >
4444``` js JavaScript & TypeScript
45- import { Sandbox } from ' @ e2b/code-interpreter '
45+ import { Sandbox } from ' e2b'
4646
4747const sandbox = await Sandbox .create ()
4848
@@ -51,7 +51,7 @@ const snapshot = await sandbox.createSnapshot()
5151console .log (' Snapshot ID:' , snapshot .snapshotId )
5252```
5353``` python Python
54- from e2b_code_interpreter import Sandbox
54+ from e2b import Sandbox
5555
5656sandbox = Sandbox.create()
5757
@@ -65,14 +65,14 @@ You can also create a snapshot by sandbox ID using the static method.
6565
6666<CodeGroup >
6767``` js JavaScript & TypeScript
68- import { Sandbox } from ' @ e2b/code-interpreter '
68+ import { Sandbox } from ' e2b'
6969
7070// Create a snapshot by sandbox ID
7171const snapshot = await Sandbox .createSnapshot (sandboxId)
7272console .log (' Snapshot ID:' , snapshot .snapshotId )
7373```
7474``` python Python
75- from e2b_code_interpreter import Sandbox
75+ from e2b import Sandbox
7676
7777# Create a snapshot by sandbox ID
7878snapshot = Sandbox.create_snapshot(sandbox_id)
@@ -86,15 +86,15 @@ The snapshot ID can be used directly with `Sandbox.create()` to spawn a new sand
8686
8787<CodeGroup >
8888``` js JavaScript & TypeScript highlight={5}
89- import { Sandbox } from ' @ e2b/code-interpreter '
89+ import { Sandbox } from ' e2b'
9090
9191const snapshot = await sandbox .createSnapshot ()
9292
9393// Create a new sandbox from the snapshot
9494const newSandbox = await Sandbox .create (snapshot .snapshotId )
9595```
9696``` python Python highlight={5}
97- from e2b_code_interpreter import Sandbox
97+ from e2b import Sandbox
9898
9999snapshot = sandbox.create_snapshot()
100100
@@ -109,7 +109,7 @@ You can list all snapshots. The method returns a paginator for iterating through
109109
110110<CodeGroup >
111111``` js JavaScript & TypeScript
112- import { Sandbox } from ' @ e2b/code-interpreter '
112+ import { Sandbox } from ' e2b'
113113
114114const paginator = Sandbox .listSnapshots ()
115115
@@ -120,7 +120,7 @@ while (paginator.hasNext) {
120120}
121121```
122122``` python Python
123- from e2b_code_interpreter import Sandbox
123+ from e2b import Sandbox
124124
125125paginator = Sandbox.list_snapshots()
126126
@@ -137,13 +137,13 @@ You can filter snapshots created from a specific sandbox.
137137
138138<CodeGroup >
139139``` js JavaScript & TypeScript
140- import { Sandbox } from ' @ e2b/code-interpreter '
140+ import { Sandbox } from ' e2b'
141141
142142const paginator = Sandbox .listSnapshots ({ sandboxId: ' your-sandbox-id' })
143143const snapshots = await paginator .nextItems ()
144144```
145145``` python Python
146- from e2b_code_interpreter import Sandbox
146+ from e2b import Sandbox
147147
148148paginator = Sandbox.list_snapshots(sandbox_id = " your-sandbox-id" )
149149snapshots = paginator.next_items()
@@ -154,13 +154,13 @@ snapshots = paginator.next_items()
154154
155155<CodeGroup >
156156``` js JavaScript & TypeScript
157- import { Sandbox } from ' @ e2b/code-interpreter '
157+ import { Sandbox } from ' e2b'
158158
159159// Returns true if deleted, false if the snapshot was not found
160160const deleted = await Sandbox .deleteSnapshot (snapshot .snapshotId )
161161```
162162``` python Python
163- from e2b_code_interpreter import Sandbox
163+ from e2b import Sandbox
164164
165165Sandbox.delete_snapshot(snapshot.snapshot_id)
166166```
0 commit comments