Open-source, secure environment with real-world tools for enterprise-grade agents.
Python agentaiai-agentai-agentscode-interpretercopilotdevelopmentdevtoolsgptgpt-4javascriptllmnextjsopenaipythonreactsoftwaretypescript
Update code snippets
Vasek Mlejnskye2ef68b6dd9d
diff --git a/apps/web/src/app/(docs)/docs/quickstart/page.mdx b/apps/web/src/app/(docs)/docs/quickstart/page.mdxindex 64e2a4e81..4bda7b6c3 100644--- a/apps/web/src/app/(docs)/docs/quickstart/page.mdx+++ b/apps/web/src/app/(docs)/docs/quickstart/page.mdx@@ -22,10 +22,10 @@ E2B_API_KEY=e2b_***Install the E2B SDK to your project by running the following command in your terminal.<CodeGroup isTerminalCommand>```bash {{ language: 'js' }}-npm i e2b dotenv+npm i @e2b/code-interpreter dotenv``````bash {{ language: 'python' }}-pip install e2b python-dotenv+pip install e2b_code_interpreter python-dotenv```</CodeGroup>@@ -34,7 +34,7 @@ We'll write the minimal code for starting Sandbox, executing Python inside it an<CodeGroup>```ts {{ language: 'js', description: 'index.ts' }}import 'dotenv/config'-import { Sandbox } from 'e2b'+import { Sandbox } from '@e2b/code-interpreter'const sbx = await Sandbox.create() // By default the sandbox is alive for 5 minutesconst execution = await sbx.runCode('print("hello world")') // Execute Python inside the sandbox@@ -47,7 +47,7 @@ console.log(files)```python {{ language: 'python', description: 'main.py' }}from dotenv import load_dotenvload_dotenv()-from e2b import Sandbox+from e2b_code_interpreter import Sandboxsbx = Sandbox() # By default the sandbox is alive for 5 minutesexecution = sbx.run_code("print('hello world')") # Execute Python inside the sandboxdiff --git a/apps/web/src/app/(docs)/docs/quickstart/upload-download-files/page.mdx b/apps/web/src/app/(docs)/docs/quickstart/upload-download-files/page.mdxindex 463acf5d1..ca1d90ffc 100644--- a/apps/web/src/app/(docs)/docs/quickstart/upload-download-files/page.mdx+++ b/apps/web/src/app/(docs)/docs/quickstart/upload-download-files/page.mdx@@ -8,7 +8,7 @@ An alternative way to get your data to the sandbox is to create a [(TODO: link)c## Upload file<CodeGroup>```ts {{ language: 'js' }}-import { Sandbox } from 'e2b'+import { Sandbox } from '@e2b/code-interpreter'// Read local fileconst content = fs.readFileSync('/local/file')@@ -19,7 +19,7 @@ await sbx.files.write('/home/user/my-file', content)``````python {{ language: 'python' }}-from e2b import Sandbox+from e2b_code_interpreter import Sandboxsbx = Sandbox.create()@@ -37,7 +37,7 @@ We're working on a better solution.<CodeGroup>```ts {{ language: 'js' }}-import { Sandbox } from 'e2b'+import { Sandbox } from '@e2b/code-interpreter'// Read local filesconst fileA = fs.readFileSync('/local/file/a')@@ -51,7 +51,7 @@ await sbx.files.write('/home/user/my-file-b', content)``````python {{ language: 'python' }}-from e2b import Sandbox+from e2b_code_interpreter import Sandboxsbx = Sandbox.create()@@ -76,7 +76,7 @@ To download a file, you need to first get the file's content and then write it t<CodeGroup>```ts {{ language: 'js' }}-import { Sandbox } from 'e2b'+import { Sandbox } from '@e2b/code-interpreter'const sbx = await Sandbox.create()// Download file from the sandbox to path '/home/user/my-file'@@ -86,7 +86,7 @@ fs.writeFileSync('/local/file', content)``````python {{ language: 'python' }}-from e2b import Sandbox+from e2b_code_interpreter import Sandboxsbx = Sandbox.create()# Download file from the sandbox to path '/home/user/my-file'@@ -105,7 +105,7 @@ We're working on a better solution.<CodeGroup>```ts {{ language: 'js' }}-import { Sandbox } from 'e2b'+import { Sandbox } from '@e2b/code-interpreter'const sbx = await Sandbox.create()// Download file A from the sandbox to path '/home/user/my-file'@@ -120,7 +120,7 @@ fs.writeFileSync('/local/file/b', contentB)``````python {{ language: 'python' }}-from e2b import Sandbox+from e2b_code_interpreter import Sandboxsbx = Sandbox.create()# Download file A from the sandbox to path '/home/user/my-file-a'