From 99fa5af914012d91d7ef192f47e0be88200fa7f5 Mon Sep 17 00:00:00 2001 From: Vasek Mlejnsky Date: Tue, 17 Dec 2024 11:44:12 -0800 Subject: [PATCH 1/3] docs: update code snippets for persistence --- .../(docs)/docs/sandbox/persistence/page.mdx | 56 +++++++++++++------ 1 file changed, 39 insertions(+), 17 deletions(-) diff --git a/apps/web/src/app/(docs)/docs/sandbox/persistence/page.mdx b/apps/web/src/app/(docs)/docs/sandbox/persistence/page.mdx index a4dff35d4..1e35d43b4 100644 --- a/apps/web/src/app/(docs)/docs/sandbox/persistence/page.mdx +++ b/apps/web/src/app/(docs)/docs/sandbox/persistence/page.mdx @@ -2,8 +2,8 @@ Sandbox persistence is currently in beta: -1. [Reach out to us](/docs/support) to get access to the beta. -1. You need to install the [beta version of the SDKs](#installing-the-beta-version-of-the-sdks). +1. [Reach out to us](/docs/support) with your use caseto get access to the beta. +1. You'll need to install the [beta version of the SDKs](#installing-the-beta-version-of-the-sdks). 1. Consider [some limitations](#limitations-while-in-beta). 1. The persistence is free for all users during the beta. @@ -17,13 +17,25 @@ To use the sandbox persistence, you need to install the beta version of the SDKs ```bash {{ language: 'js' }} -npm i e2b@beta +npm i @e2b/code-interpreter@beta +# +# or use Core: https://github.com/e2b-dev/e2b +# npm i e2b@beta +# +# or use Desktop: https://github.com/e2b-dev/desktop +# npm i @e2b/desktop@beta ``` ```bash {{ language: 'python' }} # Install the latest beta version of the SDK on PyPi # https://pypi.org/project/e2b/#history -pip install e2b-code-interpreter==1.1.0.b17 +pip install e2b-code-interpreter==1.0.4b0 +# +# or use Core: https://github.com/e2b-dev/e2b +# pip install e2b==1.1.0.b17 +# +# or use Desktop: https://github.com/e2b-dev/desktop +# pip install e2b-desktop==1.1.0.b0 ``` @@ -33,9 +45,9 @@ When you pause a sandbox, both the sandbox's filesystem and memory state will be ```js -import { Sandbox } from 'e2b' -// or use Code Interpreter: https://github.com/e2b-dev/code-interpreter -// import { Sandbox } from '@e2b/code-interpreter' +import { Sandbox } from '@e2b/code-interpreter' +// or use Core: https://github.com/e2b-dev/e2b +// import { Sandbox } from 'e2b' // // or use Desktop: https://github.com/e2b-dev/desktop // import { Sandbox } from '@e2b/desktop' @@ -50,9 +62,9 @@ const sandboxId = await sbx.pause() // $HighlightLine console.log('Sandbox paused', sandboxId) // $HighlightLine ``` ```python -from e2b import Sandbox -# or use Code Interpreter: https://github.com/e2b-dev/code-interpreter -# from e2b_code_interpreter import Sandbox +from e2b_code_interpreter import Sandbox +# or use Core: https://github.com/e2b-dev/e2b +# from e2b import Sandbox # # or use Desktop: https://github.com/e2b-dev/desktop # from e2b_desktop import Sandbox @@ -75,9 +87,9 @@ This means that all the files in the sandbox's filesystem will be restored and a ```js -import { Sandbox } from 'e2b' -// or use Code Interpreter: https://github.com/e2b-dev/code-interpreter -// import { Sandbox } from '@e2b/code-interpreter' +import { Sandbox } from '@e2b/code-interpreter' +// or use Core: https://github.com/e2b-dev/e2b +// import { Sandbox } from 'e2b' // // or use Desktop: https://github.com/e2b-dev/desktop // import { Sandbox } from '@e2b/desktop' @@ -97,8 +109,8 @@ console.log('Sandbox resumed', sameSbx.sandboxId) // $HighlightLine ``` ```python from e2b import Sandbox -# or use Code Interpreter: https://github.com/e2b-dev/code-interpreter -# from e2b_code_interpreter import Sandbox +# or use Core: https://github.com/e2b-dev/e2b +# from e2b import Sandbox # # or use Desktop: https://github.com/e2b-dev/desktop # from e2b_desktop import Sandbox @@ -126,12 +138,22 @@ You can pass a custom timeout to the `Sandbox.resume()` method like this: ```js -import { Sandbox } from 'e2b' +import { Sandbox } from '@e2b/code-interpreter' +// or use Core: https://github.com/e2b-dev/e2b +// import { Sandbox } from 'e2b' +// +// or use Desktop: https://github.com/e2b-dev/desktop +// import { Sandbox } from '@e2b/desktop' const sbx = await Sandbox.resume(sandboxId, { timeoutMs: 60 * 1000 }) // 60 seconds ``` ```python -from e2b import Sandbox +from e2b_code_interpreter import Sandbox +# or use Core: https://github.com/e2b-dev/e2b +# from e2b import Sandbox +# +# or use Desktop: https://github.com/e2b-dev/desktop +# from e2b_desktop import Sandbox sbx = Sandbox.resume(sandbox_id, timeout=60) # 60 seconds ``` From 7f79ebfa7f9689457cc08b1b4d38eb1f3115cac7 Mon Sep 17 00:00:00 2001 From: Vasek Mlejnsky Date: Tue, 17 Dec 2024 11:48:46 -0800 Subject: [PATCH 2/3] docs: update installation instructions to install latest beta in python --- .../app/(docs)/docs/sandbox/persistence/page.mdx | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/apps/web/src/app/(docs)/docs/sandbox/persistence/page.mdx b/apps/web/src/app/(docs)/docs/sandbox/persistence/page.mdx index 70fc95a0d..60b3dff20 100644 --- a/apps/web/src/app/(docs)/docs/sandbox/persistence/page.mdx +++ b/apps/web/src/app/(docs)/docs/sandbox/persistence/page.mdx @@ -18,31 +18,22 @@ To use the sandbox persistence, you need to install the beta version of the SDKs ```bash {{ language: 'js' }} npm i @e2b/code-interpreter@beta -<<<<<<< HEAD # # or use Core: https://github.com/e2b-dev/e2b # npm i e2b@beta # # or use Desktop: https://github.com/e2b-dev/desktop # npm i @e2b/desktop@beta -======= ->>>>>>> e81a6dc06d59e775bdd9579d9c3226cee35924cd ``` ```bash {{ language: 'python' }} -# Install the latest beta version of the SDK on PyPi -# https://pypi.org/project/e2b/#history -<<<<<<< HEAD -pip install e2b-code-interpreter==1.0.4b0 +pip install e2b-code-interpreter==1.0.4b # # or use Core: https://github.com/e2b-dev/e2b -# pip install e2b==1.1.0.b17 +# pip install e2b==1.1.0.b # # or use Desktop: https://github.com/e2b-dev/desktop -# pip install e2b-desktop==1.1.0.b0 -======= -pip install e2b-code-interpreter==1.0.4b ->>>>>>> e81a6dc06d59e775bdd9579d9c3226cee35924cd +# pip install e2b-desktop==1.1.0.b ``` From d3f19614cd0a41c39337635223e69ed38acf1b85 Mon Sep 17 00:00:00 2001 From: Vasek Mlejnsky Date: Tue, 17 Dec 2024 12:54:50 -0800 Subject: [PATCH 3/3] Update apps/web/src/app/(docs)/docs/sandbox/persistence/page.mdx Co-authored-by: 0div <98087403+0div@users.noreply.github.com> --- apps/web/src/app/(docs)/docs/sandbox/persistence/page.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/web/src/app/(docs)/docs/sandbox/persistence/page.mdx b/apps/web/src/app/(docs)/docs/sandbox/persistence/page.mdx index 60b3dff20..2c1d112ed 100644 --- a/apps/web/src/app/(docs)/docs/sandbox/persistence/page.mdx +++ b/apps/web/src/app/(docs)/docs/sandbox/persistence/page.mdx @@ -2,7 +2,7 @@ Sandbox persistence is currently in beta: -1. [Reach out to us](/docs/support) with your use caseto get access to the beta. +1. [Reach out to us](/docs/support) with your use case to get access to the beta. 1. You'll need to install the [beta version of the SDKs](#installing-the-beta-version-of-the-sdks). 1. Consider [some limitations](#limitations-while-in-beta). 1. The persistence is free for all users during the beta.