Skip to content

armgit / E2B

Public Imported from GitHub
0

Open-source, secure environment with real-world tools for enterprise-grade agents.

Update navigation; create first quickstart page

Vasek Mlejnsky6a5505738ac0
diff --git a/apps/web/package.json b/apps/web/package.json
index 0426d3afe..40344d7cc 100644
--- a/apps/web/package.json
+++ b/apps/web/package.json
@@ -49,7 +49,7 @@
"framer-motion": "7.8.1",
"json5": "^2.2.3",
"lodash.debounce": "^4.0.8",
- "lucide-react": "^0.268.0",
+ "lucide-react": "^0.452.0",
"mdast-util-to-string": "^3.2.0",
"mdx-annotations": "^0.1.1",
"next": "14.2.5",
diff --git a/apps/web/src/app/(docs)/docs/api-reference/cli/page.mdx b/apps/web/src/app/(docs)/docs/api-reference/cli/page.mdx
new file mode 100644
index 000000000..e7c7a60bd
--- /dev/null
+++ b/apps/web/src/app/(docs)/docs/api-reference/cli/page.mdx
@@ -0,0 +1,7 @@
+# cli
+
+## v0.5.10
+
+- [Auth](./cli/v0.5.10/auth)
+- [Sandbox](./cli/v0.5.10/sandbox)
+- [Template](./cli/v0.5.10/template)
\ No newline at end of file
diff --git a/apps/web/src/app/(docs)/docs/api-reference/cli/v0.5.10/page.mdx b/apps/web/src/app/(docs)/docs/api-reference/cli/v0.5.10/page.mdx
new file mode 100644
index 000000000..81d506d76
--- /dev/null
+++ b/apps/web/src/app/(docs)/docs/api-reference/cli/v0.5.10/page.mdx
@@ -0,0 +1,5 @@
+# CLI v0.5.10
+
+- [Auth](./v0.5.10/auth)
+- [Sandbox](./v0.5.10/sandbox)
+- [Template](./v0.5.10/template)
\ No newline at end of file
diff --git a/apps/web/src/app/(docs)/docs/api-reference/js-sdk/page.mdx b/apps/web/src/app/(docs)/docs/api-reference/js-sdk/page.mdx
new file mode 100644
index 000000000..31f99c819
--- /dev/null
+++ b/apps/web/src/app/(docs)/docs/api-reference/js-sdk/page.mdx
@@ -0,0 +1,8 @@
+# js-sdk
+
+## v0.16.2-beta.52
+
+- [Errors](./js-sdk/v0.16.2-beta.52/errors)
+- [Filesystem](./js-sdk/v0.16.2-beta.52/filesystem)
+- [Process](./js-sdk/v0.16.2-beta.52/process)
+- [Sandbox](./js-sdk/v0.16.2-beta.52/sandbox)
\ No newline at end of file
diff --git a/apps/web/src/app/(docs)/docs/api-reference/js-sdk/v0.16.2-beta.52/page.mdx b/apps/web/src/app/(docs)/docs/api-reference/js-sdk/v0.16.2-beta.52/page.mdx
new file mode 100644
index 000000000..c8ed10b27
--- /dev/null
+++ b/apps/web/src/app/(docs)/docs/api-reference/js-sdk/v0.16.2-beta.52/page.mdx
@@ -0,0 +1,6 @@
+# JS-SDK v0.16.2-beta.52
+
+- [Errors](./v0.16.2-beta.52/errors)
+- [Filesystem](./v0.16.2-beta.52/filesystem)
+- [Process](./v0.16.2-beta.52/process)
+- [Sandbox](./v0.16.2-beta.52/sandbox)
\ No newline at end of file
diff --git a/apps/web/src/app/(docs)/docs/api-reference/python-sdk/page.mdx b/apps/web/src/app/(docs)/docs/api-reference/python-sdk/page.mdx
new file mode 100644
index 000000000..b4fe1cb74
--- /dev/null
+++ b/apps/web/src/app/(docs)/docs/api-reference/python-sdk/page.mdx
@@ -0,0 +1,7 @@
+# python-sdk
+
+## v0.17.1
+
+- [Exceptions](./python-sdk/v0.17.1/exceptions)
+- [Sandbox_async](./python-sdk/v0.17.1/sandbox_async)
+- [Sandbox_sync](./python-sdk/v0.17.1/sandbox_sync)
\ No newline at end of file
diff --git a/apps/web/src/app/(docs)/docs/api-reference/python-sdk/v0.17.1/page.mdx b/apps/web/src/app/(docs)/docs/api-reference/python-sdk/v0.17.1/page.mdx
new file mode 100644
index 000000000..5412451ea
--- /dev/null
+++ b/apps/web/src/app/(docs)/docs/api-reference/python-sdk/v0.17.1/page.mdx
@@ -0,0 +1,5 @@
+# PYTHON-SDK v0.17.1
+
+- [Exceptions](./v0.17.1/exceptions)
+- [Sandbox_async](./v0.17.1/sandbox_async)
+- [Sandbox_sync](./v0.17.1/sandbox_sync)
\ No newline at end of file
diff --git a/apps/web/src/app/(docs)/docs/cli/commands/page.mdx b/apps/web/src/app/(docs)/docs/cli/commands/page.mdx
deleted file mode 100644
index 53809a229..000000000
--- a/apps/web/src/app/(docs)/docs/cli/commands/page.mdx
+++ /dev/null
@@ -1,333 +0,0 @@
-# CLI Commands
-
-Build your sandbox with our CLI. {{ className: 'lead' }}
-
-<Note>
-You can use `--help` flag for more information about commands.
-</Note>
-
----
-
-# Auth
-
-<br/>
-
-## `auth login`
-
-Log in to the CLI. It will save your access token in `~/.e2b` file.
-
-```bash
-e2b auth login
-```
-
-## `auth logout`
-
-Log out of the CLI. It will remove your access token from `~/.e2b` file.
-
-```
-e2b auth logout
-```
-
-## `auth configure`
-
-Configure the default team for the CLI. It will be used for all commands that require a team.
-
-```bash
-e2b auth configure
-```
-
-## `auth info`
-
-Get info about your current user.
-
-```
-e2b auth info
-```
-
----
-
-# Templates
-
-<br/>
-
-## `template init`
-
-Creates a basic Dockerfile (`./e2b.Dockerfile`) in current directory.
-You can then run `e2b template build` to build sandbox template from this Dockerfile.
-
-```bash
-e2b template init
-```
-
-#### **Options**
-
-<Options>
- <Option name="path" type="-p, --path">
- Change the root directory where the command is executed to `path` directory.
- </Option>
-</Options>
-
-
-## `template build`
-
-Builds a sandbox template defined by `./e2b.Dockerfile` or `./Dockerfile` from the root directory.
-By default, the root directory is the current working directory.
-This command also creates the `e2b.toml` config.
-
-```bash
-e2b template build
-```
-
-<Note>
-Running `e2b template build` without specifying a template with the `[template]` argument will rebuild template defined by the `e2b.toml` config.
-
-If there is no `e2b.toml` config a new template will be created.
-</Note>
-
-#### **Arguments**
-
-<Options>
- <Option type="[template]">
- Specify the template you want to rebuild. You can use the template name or ID.
- </Option>
-</Options>
-
-
-#### **Options**
-
-<Options>
- <Option type="-c, --cmd" name="start-command">
- Specify the command that should be running when a sandbox starts.
- </Option>
- <Option type="--config" name="e2b-toml">
- Specify the path to the config file. By default, E2B tries to find `e2b.toml` in the root directory.
- </Option>
- <Option type="-n, --name" name="template-name">
- Specify the name of the sandbox template. You can use the template name to start the sandbox in the SDK. The name must be lowercase and contain only letters, numbers, dashes, and underscores.
- </Option>
- <Option type="-p, --path" name="path">
- Change the root directory where the command is executed to the `path` directory.
- </Option>
- <Option type="-d, --dockerfile" name="dockerfile">
- Specify the path to Dockerfile. By default E2B tries to find `e2b.Dockerfile` or `Dockerfile` in the root directory.
- </Option>
- <Option type="-t, --team" name="team">
- Specify the team that will be used for the sandbox template. You can find team ID in the team settings in the [E2B dashboard](https://e2b.dev/dashboard?tab=team).
- </Option>
- <Option type="--cpu-count" name="cpu-count">
- Specify the number of CPUs that will be used to run the sandbox. The default value is 2.
- </Option>
- <Option type="--memory-mb" name="memory-mb">
- Specify the amount of memory in megabytes that will be used to run the sandbox. Must be an even number. The default value is 512.
- </Option>
- <Option type="--build-arg" name="build-arg">
- Specify a build argument for the Dockerfile. The format is `key=value`. You can use this option multiple times.
- </Option>
-</Options>
-
-## `template delete`
-
-Delete the sandbox template specified by the `[template]` argument, `e2b.toml` config in the working directory, or by an interactive selection.
-By default, the root directory is the current working directory.
-
-This command also deletes the `e2b.toml` config.
-
-```bash
-e2b template delete
-```
-
-<Note>
-Running `e2b template delete` without specifying a template with the `[template]` argument will delete the template defined by the `e2b.toml` config.
-</Note>
-
-#### **Arguments**
-
-<Options>
- <Option type="[template]">
- Specify the template you want to delete. You can use the template name or ID.
- </Option>
-</Options>
-
-
-#### **Options**
-
-<Options>
- <Option type="-p, --path" name="path">
- Change the root directory where the command is executed to the `path` directory.
- </Option>
- <Option type="--config" name="e2b-toml">
- Specify the path to the config file. By default, E2B tries to find `e2b.toml` in the root directory.
- </Option>
- <Option type="-s, --select">
- Interactively select sandbox templates you want to delete.
- </Option>
- <Option type="-y, --yes">
- Don't ask for confirmation before deleting the sandbox template.
- </Option>
- <Option type="-t, --team" name="team">
- Specify the team that will be used for the sandbox template. You can find team ID in the team settings in the [E2B dashboard](https://e2b.dev/dashboard?tab=team).
- </Option>
-</Options>
-
-
-## `template list`
-
-List your sandbox templates.
-
-```bash
-e2b template list
-```
-
-#### **Options**
-
-<Options>
- <Option type="-t, --team" name="team">
- Specify the team that will be used for the sandbox template. You can find team ID in the team settings in the [E2B dashboard](https://e2b.dev/dashboard?tab=team).
- </Option>
-</Options>
-
-
----
-
-# Sandboxes
-
-<br/>
-
-## `sandbox list`
-
-List your spawned sandboxes that are running right now.
-
-```bash
-e2b sandbox list
-```
-
-
-## `sandbox logs`
-Starts printing logs from the specified sandbox.
-If the sandbox is running new logs will be streamed to the terminal.
-
-The timestamps are in the UTC format.
-
-This command is useful if you need to debug a running sandbox or check logs from a sandbox that was already closed.
-
-```bash
-e2b sandbox logs <sandboxID>
-```
-
-<Note>
-You can use `e2b sandbox list` to get a list of running sandboxes and their IDs that can be used with `e2b sandbox logs <sandboxID>` command.
-</Note>
-
-#### **Arguments**
-
-<Options>
- <Option type="<sandboxID>">
- Specify the ID of the sandbox you want to get logs from.
- </Option>
-</Options>
-
-#### **Options**
-
-<Options>
- <Option name="level" type="--level">
- Filter logs by level — allowed values are `DEBUG`, `INFO`, `WARN`, `ERROR`.
- The logs with the higher levels will be also shown.
-
- Default value is `DEBUG`.
- </Option>
- <Option type="-f, --follow">
- Enable streaming logs until the sandbox is closed.
- </Option>
- <Option name="format" type="--format">
- Specify format for printing logs — allowed values are `pretty`, `json`.
-
- Default value is `pretty`.
- </Option>
- <Option name="loggers" type="--loggers">
- Specify enabled loggers — allowed values are `process`, `filesystem`, `terminal`, `network` and `file`.
- You can specify multiple loggers by separating them with a comma.
-
- Default value is `process,filesystem`.
- </Option>
-</Options>
-
-## `sandbox connect`
-
-Connects your terminal to a running sandbox that you spawned via the E2B SDK.
-This command is useful if you need to debug a running sandbox.
-
-This command works similar to the `docker exec -it <container> bash` command in Docker.
-
-```bash
-e2b sandbox connect <sandboxID>
-```
-
-<Note>
-You can use `e2b sandbox list` to get a list of running sandboxes and their IDs that can be used with `e2b sandbox connect <sandboxID>` command.
-</Note>
-
-#### **Arguments**
-
-<Options>
- <Option type="<sandboxID>">
- Specify the ID of a running sandbox you want to connect to.
- </Option>
-</Options>
-
-## `sandbox spawn`
-
-Spawns a sandbox and connects your terminal to the sandbox.
-This command can be used to debug your sandbox template.
-
-This command works similar to the `docker run -it <image> bash` command in Docker.
-
-```bash
-e2b sandbox spawn
-```
-
-<Note>
-Running `e2b sandbox spawn` without specifying a template with the `[template]` argument will spawn sandbox defined by the `e2b.toml` config.
-</Note>
-
-#### **Arguments**
-
-<Options>
- <Option type="[template]">
- Specify the template you want to spawn sandbox from. You can use the template name or ID.
- </Option>
-</Options>
-
-
-#### **Options**
-
-<Options>
- <Option name="path" type="-p, --path">
- Change the root directory where the command is executed to `path` directory.
- </Option>
- <Option type="--config" name="e2b-toml">
- Specify the path to the config file. By default, E2B tries to find `e2b.toml` in the root directory.
- </Option>
-</Options>
-
-## `sandbox kill`
-
-Immediately kill a running sandbox or all running sandboxes.
-
-```bash
-e2b sandbox kill [sandboxID]
-```
-#### **Arguments**
-
-<Options>
- <Option type="[sandboxID]">
- Specify the ID of the sandbox you want to kill.
- </Option>
-</Options>
-
-#### **Options**
-
-<Options>
- <Option type="-a, --all">
- Kill all running sandboxes.
- </Option>
-</Options>
diff --git a/apps/web/src/app/(docs)/docs/cli/installation/page.mdx b/apps/web/src/app/(docs)/docs/cli/installation/page.mdx
deleted file mode 100644
index 2cbfbc284..000000000
--- a/apps/web/src/app/(docs)/docs/cli/installation/page.mdx
+++ /dev/null
@@ -1,22 +0,0 @@
-# Installation
-
-You build and manage sandbox templates with our CLI. {{ className: 'lead' }}
-
-The CLI is distributed as an [NPM package](https://www.npmjs.com/package/e2b).
-
-## Download CLI
-
-You can install the CLI with following command:
-
-```bash
-npm install -g @e2b/cli@latest
-```
-
-## Login
-
-You'll need to login to your account to start using the CLI.
-You'll be redirected to the browser after running the following command to finish the login.
-
-```bash
-e2b auth login
-```
\ No newline at end of file
diff --git a/apps/web/src/app/(docs)/docs/code-interpreter/examples/page.mdx b/apps/web/src/app/(docs)/docs/code-interpreter/examples/page.mdx
deleted file mode 100644
index 0740a3fe2..000000000
--- a/apps/web/src/app/(docs)/docs/code-interpreter/examples/page.mdx
+++ /dev/null
@@ -1,144 +0,0 @@
-# Examples
-
-Here are some examples of how to use the E2B Code Interpreter package. If you are missing something, please let us know.
-
-## Minimal example with the sharing context
-
-The following example demonstrates how to create a shared context between multiple code executions. This is useful when you want to share variables between different code cells.
-
-<CodeGroup isRunnable={false}>
-```js
-import { CodeInterpreter } from '@e2b/code-interpreter'
-
-const sandbox = await CodeInterpreter.create()
-await sandbox.notebook.execCell('x = 1')
-
-const execution = await sandbox.notebook.execCell('x+=1; x')
-console.log(execution.text) // outputs 2
-
-await sandbox.close()
-```
-```python
-from e2b_code_interpreter import CodeInterpreter
-
-with CodeInterpreter() as sandbox:
- sandbox.notebook.exec_cell("x = 1")
-
- execution = sandbox.notebook.exec_cell("x+=1; x")
- print(execution.text) # outputs 2
-
-```
-</CodeGroup>
-
-## Get charts and any display-able data
-
-<CodeGroup isRunnable={false}>
-```js
-import { CodeInterpreter } from '@e2b/code-interpreter'
-
-const sandbox = await CodeInterpreter.create()
-
-const code = `
-import matplotlib.pyplot as plt
-import numpy as np
-
-x = np.linspace(0, 20, 100)
-y = np.sin(x)
-
-plt.plot(x, y)
-plt.show()
-`;
-
-// you can install dependencies in "jupyter notebook style"
-await sandbox.notebook.execCell("!pip install matplotlib")
-
-const execution = await sandbox.notebook.execCell(code)
-
-// this contains the image data, you can e.g. save it to file or send to frontend
-execution.results[0].png
-
-await sandbox.close()
-```
-```python
-import base64
-import io
-
-from matplotlib import image as mpimg, pyplot as plt
-
-from e2b_code_interpreter import CodeInterpreter
-
-code = """
-import matplotlib.pyplot as plt
-import numpy as np
-
-x = np.linspace(0, 20, 100)
-y = np.sin(x)
-
-plt.plot(x, y)
-plt.show()
-"""
-
-with CodeInterpreter() as sandbox:
- # you can install dependencies in "jupyter notebook style"
- sandbox.notebook.exec_cell("!pip install matplotlib")
-
- # plot random graph
- execution = sandbox.notebook.exec_cell(code)
-
-# there's your image
-image = execution.results[0].png
-
-# example how to show the image / prove it works
-i = base64.b64decode(image)
-i = io.BytesIO(i)
-i = mpimg.imread(i, format='PNG')
-
-plt.imshow(i, interpolation='nearest')
-plt.show()
-```
-</CodeGroup>
-
-## Streaming code output
-
-<CodeGroup isRunnable={false}>
-```js
-import { CodeInterpreter } from "@e2b/code-interpreter";
-
-code = `
-import time
-import pandas as pd
-
-print("hello")
-time.sleep(3)
-data = pd.DataFrame(data=[[1, 2], [3, 4]], columns=["A", "B"])
-display(data.head(10))
-time.sleep(3)
-print("world")
-`
-
-const sandbox = await CodeInterpreter.create()
-
-await sandbox.notebook.execCell(code, {
- onStdout: (out) => console.log(out),
- onStderr: (outErr) => console.error(outErr),
- onResult: (result) => console.log(result.text)
-})
-````
-```python
-from e2b_code_interpreter import CodeInterpreter
-
-code = """
-import time
-import pandas as pd
-
-print("hello")
-time.sleep(3)
-data = pd.DataFrame(data=[[1, 2], [3, 4]], columns=["A", "B"])
-display(data.head(10))
-time.sleep(3)
-print("world")
-"""
-with CodeInterpreter() as sandbox:
- sandbox.notebook.exec_cell(code, on_stdout=print, on_stderr=print, on_result=(lambda result: print(result.text)))
-```
-</ CodeGroup>
diff --git a/apps/web/src/app/(docs)/docs/code-interpreter/execution/page.mdx b/apps/web/src/app/(docs)/docs/code-interpreter/execution/page.mdx
deleted file mode 100644
index 7dee1435f..000000000
--- a/apps/web/src/app/(docs)/docs/code-interpreter/execution/page.mdx
+++ /dev/null
@@ -1,195 +0,0 @@
-import Link from 'next/link'
-
-# Code Execution
-
-You can execute code using the notebook module, using the `execCell` method. The method takes a string of code as an argument and returns an object with the results of the execution.
-
-<CodeGroup isRunnable={false}>
-```js
-import { CodeInterpreter } from '@e2b/code-interpreter'
-
-const code = 'print("Hello, World!")'
-
-const sandbox = CodeInterpreter.create()
-const execution = await sandbox.notebook.execCell(code)
-```
-
-```python
-from e2b_code_interpreter import CodeInterpreter
-
-code = "print('Hello, World!')"
-
-sandbox = CodeInterpreter.create()
-execution = sandbox.notebook.exec_cell(code)
-```
-</CodeGroup>
-
-The `execCell` method also accepts following optional arguments:
-- `kernel id`: The ID of the kernel to execute the code on. If not provided, the default kernel is used. See <Link href="/code-interpreter/kernels">here</Link> for more info on kernels.
-- `on stdout`: A callback function to handle standard output messages from the code execution.
-- `on_stderr`: A callback function to handle standard error messages from the code execution.
-- `on_result`: A callback function to handle the result and display calls of the code execution.
-
-## Streaming response
-
-You can use the `on_*` callbacks to handle the output of the code execution as it happens. This is useful for long-running code. You can stream the output to the user as it is generated.
-
-## Execution object
-
-The object returned by the `exec cell` method is little bit more complex, it's based on Jupyter. Here's an detailed explanation in the [Jupyter documentation](https://jupyter-client.readthedocs.io/en/stable/messaging.html).
-
-It contains the following fields:
-
-- `results`: A list containing result of the cell (interactively interpreted last line) and display calls (e.g. matplotlib plots).
-- `logs`: Logs printed to stdout and stderr during execution.
-- `error`: An error message, if there was an error during execution of the cell. It works only for Python code, not for system (`!` e.g `!pip install e2b`) commands.
-
-### Result object
-
-This object can be created in two different ways:
-- Evaluation of the last line: If the last line of the code is an expression, the result is the value of that expression. As you would expect in REPL environments.
-- Display calls: Calls to display functions, which can be used to display rich output in the notebook. E.g. [`img.show()`](https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.show.html), [`display(img)`](https://ipython.readthedocs.io/en/stable/api/generated/IPython.display.html), etc.
-
-Represents the data to be displayed as a result of executing a cell in a Jupyter notebook.
-The result is similar to the structure returned by [ipython kernel](https://ipython.readthedocs.io/en/stable/development/execution.html#execution-semantics)
-
-The result can contain multiple types of data, such as text, images, plots, etc. Each type of data is represented
-as a string, and the result can contain multiple types of data. The display calls don't have to have text representation, it's always present for the actual result,
-the other representations are optional.
-
-The result has those basic data types:
-
-#### Text types:
-- `text`: text representation of the result
-- `html`: html representation of the result
-- `markdown`: markdown representation of the result
-- `latex`: latex representation of the result
-
-#### Image types:
- - `png`: "base64 encoded png image",
- - `jpeg`: "base64 encoded jpeg image",
- - `svg`": "svg image",
-
-#### Other types:
- - `json`: "json representation",
- - `javascript`: "javascript representation",
- - `pdf`: "base64 encoded pdf"
-
-<Note>
- If you want to integrate your own display formats or how to implement them for your classes, you can read more in [here](https://github.com/ipython/ipython/blob/main/examples/IPython%20Kernel/Custom%20Display%20Logic.ipynb)
-</Note>
-
-### Logs object
-
-Logs printed to stdout and stderr during execution. Examples of logs are print statements, warnings, subprocess output, etc.
-
-It contains two fields:
-- `stdout`: List of strings, each string is a line printed to stdout.
-- `stderr`: List of strings, each string is a line printed to stderr.
-
-### Error object
-
-An error message, if there was an error during execution of the cell.
-<Note>
- It works only for Python code, not for system (e.g. `!pip install non_existent_package`) commands. The system commands are executed in a separate process and the output is in stdout/stderr.
-</Note>
-
-It contains three fields:
-- `name`: Name of the error, e.g. `NameError`, `ValueError`, etc.
-- `value`: Value of the error, e.g. `name 'non_existent_variable' is not defined`, etc.
-- `traceback`: Traceback of the error.
-
-
-## Example how to interpret the results to LLM
-
-Here's an example how to return the results to LLM:
-
-<CodeGroup isRunnable={false}>
-```js
-const code = '<CODE GENERATED BY LLM>'
-const execution = await sandbox.notebook.execCell(code)
-
-// There was an error during execution, return the error and its traceback
-if (execution.error) {
- return `There was an error during execution: ${execution.error.name}: ${execution.error.value}.\n
- ${execution.error.traceback}`
-}
-
-// The execution has some result, summarize to LLM, what are the results
-if (execution.results.length > 0) {
- let message = 'These are results of the execution:\n'
- let counter = 1
- for (const result of execution.results) {
- message += `Result ${counter++}:\n`
- if (result.isMainResult) {
- message += `[Main result]: ${result.text}\n`
- } else {
- message += `[Display data]: ${result.text}\n`
- }
- if (result.formats().length > 0) {
- message += `It has following formats: ${result.formats()}\n`
- }
- }
-
- return message
-}
-
-// There were no results, check if there was something is stdout/err
-if (
- execution.logs.stdout.length > 0 ||
- execution.logs.stderr.length > 0
-) {
- let message = 'There was no result of the execution, but here are the logs:\n'
- if (execution.logs.stdout.length > 0) {
- message += `Stdout: ${execution.logs.stdout.join('\n')}\n`
- }
- if (execution.logs.stderr.length > 0) {
- message += `Stderr: ${execution.logs.stderr.join('\n')}\n`
- }
-
- return message
-}
-
-return 'There was no output of the execution.'
-```
-
-```python
-code = "<CODE GENERATED BY LLM>"
-execution = sandbox.notebook.exec_cell(code)
-
-# There was an error during execution, return the error and its traceback
-if execution.error:
- return (
- f"There was an error during execution: {execution.error.name}: {execution.error.value}.\n"
- f"{execution.error.traceback}"
- )
-
-# The execution has some result, summarize to LLM, what are the results
-if execution.results:
- message = "These are results of the execution:\n"
- for i, result in enumerate(execution.results):
- message += f"Result {i + 1}:\n"
- if result.is_main_result:
- message += f"[Main result]: {result.text}\n"
- else:
- message += f"[Display data]: {result.text}\n"
-
- if result.formats():
- message += f"It has also following formats: {result.formats()}\n"
-
- return message
-
-# There were no results, check if there was something is stdout/err
-if execution.logs.stdout or execution.logs.stderr:
- message = "There was no result of the execution, but here are the logs:\n"
- if execution.logs.stdout:
- message += "Stdout: " + "\n".join(execution.logs.stdout) + "\n"
-
- if execution.logs.stderr:
- message += "Stderr: " + "\n".join(execution.logs.stderr) + "\n"
-
- return message
-
-return "There was no output of the execution."
-```
-</CodeGroup>
diff --git a/apps/web/src/app/(docs)/docs/code-interpreter/installation/page.mdx b/apps/web/src/app/(docs)/docs/code-interpreter/installation/page.mdx
deleted file mode 100644
index 5408877d9..000000000
--- a/apps/web/src/app/(docs)/docs/code-interpreter/installation/page.mdx
+++ /dev/null
@@ -1,54 +0,0 @@
-# Code Interpreter SDK
-E2B's [Code Interpreter SDK](https://github.com/e2b-dev/code-interpreter) allows you to add code interpreting capabilities to your AI apps.
-
-The code interpreter runs inside the [E2B Sandbox](https://github.com/e2b-dev/e2b) - an open-source secure sandbox made for running untrusted AI-generated code and AI agents.
-- ✅ Works with any LLM and AI framework
-- ✅ Supports streaming content like charts and stdout, stderr
-- ✅ Python & JS SDK
-- ✅ Runs on serverless and edge functions
-- ✅ Runs AI-generated code in secure sandboxed environments
-- ✅ 100% open source (including [infrastructure](https://github.com/e2b-dev/infra))
-
-## Quickstart
-
-### 1. Install SDK
-
-JavaScript/TypeScript
-```
-npm i @e2b/code-interpreter
-```
-
-Python
-```
-pip install e2b_code_interpreter
-```
-
-### 2. Execute code with code interpreter inside sandbox
-
-**JavaScript**
-```ts
-import { CodeInterpreter } from '@e2b/code-interpreter'
-
-const sandbox = await CodeInterpreter.create()
-await sandbox.notebook.execCell('x = 1')
-
-const execution = await sandbox.notebook.execCell('x+=1; x')
-console.log(execution.text) // outputs 2
-
-await sandbox.close()
-```
-
-**Python**
-```py
-from e2b_code_interpreter import CodeInterpreter
-
-with CodeInterpreter() as sandbox:
- sandbox.notebook.exec_cell("x = 1")
-
- execution = sandbox.notebook.exec_cell("x+=1; x")
- print(execution.text) # outputs 2
-```
-
-### 3. Hello World guide
-Dive depeer and check out the [JavaScript](/docs/hello-world/js) and [Python](/docs/hello-world/py) the Hello World guides to learn how o connect code interpreter LLMs.
-
diff --git a/apps/web/src/app/(docs)/docs/code-interpreter/kernels/page.mdx b/apps/web/src/app/(docs)/docs/code-interpreter/kernels/page.mdx
deleted file mode 100644
index d6ed0bfa4..000000000
--- a/apps/web/src/app/(docs)/docs/code-interpreter/kernels/page.mdx
+++ /dev/null
@@ -1,27 +0,0 @@
-import Link from 'next/link'
-
-# Kernels
-
-In this section you can find information about kernels and how to use them in Code Interpreter SDK. Having multiple kernels allows you to run code in separate contexts and optionally also languages.
-
-By default the template starts with one default kernel. This kernel is used to execute code, if you don't specify `kernelID`. You can imagine kernel as a separate environment where code is executed. You can have multiple kernels running at the same time. Each kernel has its own state, so you can have multiple kernels running different code at the same time.
-
-Kernel will be kept alive with the sandbox even if you disconnect.
-
-## Creating a new kernel
-
-To create a new kernel there's a `create_kernel` in Python and `createKernel()` in JavaScript/TypeScript method in the `CodeInterpreter` class. This method takes two optional arguments:
-- `cwd` - working directory for the kernel, all system commands and file operations will be executed in this directory
-- `kernel name` - kernel spec name (defaults to default kernel spec for server). In our case it's `python3`. If you want to use another kernel, you have to install in the template first. In that case you probably want to use <Link href='/code-interpreter/template'>Custom Template</Link>.
-
-## Restarting a kernel
-
-To restart a kernel you can use `restart` method. This method takes one argument - `kernelID`, if not specifed it will restart the default kernel. This method will restart the kernel and clear its state.
-
-## Listing kernels
-
-To list all kernels you can use `list` method. This method returns an array of all running kernels with their IDs and kernel spec names.
-
-## Shutting down a kernel
-
-To shutdown a kernel you can use `shutdown` method. This method takes one argument - `kernelID`, if not specifed it will delete the default kernel. This method will delete the kernel and all its state.
diff --git a/apps/web/src/app/(docs)/docs/code-interpreter/template/page.mdx b/apps/web/src/app/(docs)/docs/code-interpreter/template/page.mdx
deleted file mode 100644
index 5e713bda9..000000000
--- a/apps/web/src/app/(docs)/docs/code-interpreter/template/page.mdx
+++ /dev/null
@@ -1,58 +0,0 @@
-import Link from 'next/link'
-import { FileCode } from 'lucide-react'
-
-# Using custom sandbox template & custom compute with Code Interpreter SDK
-
-If you want to customize the Code Interprerter sandbox (e.g.: add a preinstalled package) you can do that by using a [custom sandbox template](https://e2b.dev/docs/sandbox/templates/overview).
-
-
-## Step-by-step guide
-1. Create custom sandbox by following [this guide](https://e2b.dev/docs/guide/custom-sandbox)
-
-2. Use prebuilt [E2B Code Interpreter image](https://hub.docker.com/r/e2bdev/code-interpreter) by replacing the `FROM` command in your `e2b.Dockerfile` with following
-
- ```sh
- FROM e2bdev/code-interpreter:latest
- ```
-
-3. Run the following in the same directory where's your `e2b.toml`
- ```sh
- e2b template build -c "/root/.jupyter/start-up.sh"
- ```
-
-4. Use your custom sandbox with Code Interpreter SDK
-
- **Python**
- ```python
- from e2b_code_interpreter import CodeInterpreter
- sandbox = CodeInterpreter(template="your-custom-sandbox-name")
- execution = sandbox.notebook.exec_cell("print('hello')")
- sandbox.close()
-
- # Or you can use `with` which handles closing the sandbox for you
- with CodeInterpreter(template="your-custom-sandbox-name") as sandbox:
- execution = sandbox.notebook.exec_cell("print('hello')")
- ```
-
-
- **JavaScript/TypeScript**
- ```js
- import { CodeInterpreter } from '@e2b/code-interpreter'
- const sandbox = await CodeInterpreter.create({ template: 'your-custom-sandbox-name' })
- const execution = await sandbox.notebook.execCell('print("hello")')
- await sandbox.close()
- ```
-
-
-## Customize CPU & RAM of your sandbox
-You can customize number of CPUs and MiB of RAM for your sandbox. To achieve that, specify the `--cpu-count` and `--memory-mb` options during the build step:
-```sh
-e2b template build -c "/home/user/.jupyter/start-up.sh" --cpu-count 4 --memory-mb 4096
-```
-The above will create a custom sandbox with 4 CPUs a 4 GiB of RAM.
-
-## How to install another Python kernels
-
-Jupyter has ability to work with different than Python kernel. It even supports multiple kernels in one notebook. If you want to install another kernels.
-
-You can find list of available kernels [here](https://github.com/jupyter/jupyter/wiki/Jupyter-kernels). Each has a little bit different installation process, but in general you need to install kernel package and register it in jupyter.
diff --git a/apps/web/src/app/(docs)/docs/examples/clone-repo/page.mdx b/apps/web/src/app/(docs)/docs/examples/clone-repo/page.mdx
deleted file mode 100644
index 9ee84a924..000000000
--- a/apps/web/src/app/(docs)/docs/examples/clone-repo/page.mdx
+++ /dev/null
@@ -1 +0,0 @@
-# Clone GitHub Repository
\ No newline at end of file
diff --git a/apps/web/src/app/(docs)/docs/getting-help/page.mdx b/apps/web/src/app/(docs)/docs/getting-help/page.mdx
deleted file mode 100644
index 786c2dbe1..000000000
--- a/apps/web/src/app/(docs)/docs/getting-help/page.mdx
+++ /dev/null
@@ -1,7 +0,0 @@
-# Getting help
-
-If you have any questions, issues, or feature requests, please reach out on of the following channels: {{ className: 'lead' }}
-- Send us an email at [[email protected]](mailto:[email protected])
-- Talk to us on our [Discord server](https://discord.gg/U7KEcGErtQ)
-- Open an issue on [our GitHub](https://github.com/e2b-dev/e2b)
-- Reach out on [Twitter / X](https://twitter.com/e2b_dev)
\ No newline at end of file
diff --git a/apps/web/src/app/(docs)/docs/getting-started/api-key/APIKey.tsx b/apps/web/src/app/(docs)/docs/getting-started/api-key/APIKey.tsx
deleted file mode 100644
index 68487771f..000000000
--- a/apps/web/src/app/(docs)/docs/getting-started/api-key/APIKey.tsx
+++ /dev/null
@@ -1,129 +0,0 @@
-'use client'
-
-import Link from 'next/link'
-import clsx from 'clsx'
-import { usePostHog } from 'posthog-js/react'
-
-import { useAccessToken, useApiKey, useUser } from '@/utils/useUser'
-import { obfuscateSecret } from '@/utils/obfuscate'
-import { Button } from '@/components/Button'
-import { CopyButton } from '@/components/CopyButton'
-import { Note } from '@/components/mdx'
-
-export function CopyableSecret({
- secret,
- onAfterCopy,
- obfuscateStart,
- obfuscateEnd,
-}: {
- secret: string;
- onAfterCopy: () => void;
- obfuscateStart?: number;
- obfuscateEnd?: number;
-}) {
- return (
- <div className="relative flex">
- <span className="whitespace-nowrap font-mono text-yellow-400 group-hover:opacity-0">
- {obfuscateSecret(secret, obfuscateStart, obfuscateEnd)}
- </span>
- <span className="absolute inset-0">
- <CopyButton
- code={secret}
- onAfterCopy={onAfterCopy}
- customPositionClassNames={clsx(
- 'top-[-2px] bottom-[2px]' /* nudge 2px up*/,
- 'left-[-8px] right-[-8px]' /* widen a little to fit nicely */,
- 'min-h-[28px]'
- )}
- />
- </span>
- </div>
- )
-}
-
-function SecretBlock({ name, description, secret, posthog, tip }) {
- return (
- <div className="flex flex-col space-y-1">
- <h2 className="flex flex-row items-center justify-items-end align-text-bottom mt-6">
- <span>{name}</span>
- <div className="group text-sm ml-4 border-2 mt-1 outline-2 outline-offset-2 outline-zinc-700 rounded-full px-[8px]">
- <CopyableSecret
- secret={secret}
- onAfterCopy={() => posthog?.capture('copied API key')}
- obfuscateStart={12}
- obfuscateEnd={5}
- />
- </div>
- </h2>
- <span>{description}</span>
- <span>{tip}</span>
- </div>
- )
-}
-
-function APIKey() {
- const { user } = useUser()
- const apiKey = useApiKey()
- const posthog = usePostHog()
- const accessToken = useAccessToken()
-
- return (
- <div className="flex flex-col items-start justify-start -mb-6">
- {user ? (
- <div className="flex flex-col space-y-4">
- <SecretBlock
- name="API Key"
- description={
- <span>
- Use for <strong>running</strong> the sandboxes.
- </span>
- }
- secret={apiKey}
- posthog={posthog}
- tip={
- <span>
- Set as <code>E2B_API_KEY</code> environment variable to avoid passing it
- every time.
- </span>
- }
- />
- <SecretBlock
- name="Access Token"
- description={
- <div className="flex flex-col">
- <span>
- Used only in the CLI, <strong>not needed in the SDK</strong>.
- </span>
- <span>
- Access token is for <strong>managing</strong> sandboxes with CLI - list/kill/connect, and for building custom sandbox templates with CLI.
- </span>
- <span>
- Acess token is not needed when logging in CLI via <code>e2b auth login</code>.
- </span>
- </div>
- }
- secret={accessToken}
- posthog={posthog}
- tip={
- <Note>
- <div className="flex flex-col">
- <span>To authenticate without the browser, you can set <code>E2B_ACCESS_TOKEN</code> as an environment variable.</span>
- <span>This can be useful for CI/CD pipelines.</span>
- </div>
- </Note>
- }
- />
- </div>
- ) : (
- <div className="flex flex-col items-start justiy-start gap-4 mt-6">
- <span>You can get your API key by signing up.</span>
- <Link href="/auth/sign-up">
- <Button>Sign up to get your API key</Button>
- </Link>
- </div>
- )}
- </div>
- )
-}
-
-export default APIKey
diff --git a/apps/web/src/app/(docs)/docs/getting-started/api-key/page.mdx b/apps/web/src/app/(docs)/docs/getting-started/api-key/page.mdx
deleted file mode 100644
index 4cb0c2f39..000000000
--- a/apps/web/src/app/(docs)/docs/getting-started/api-key/page.mdx
+++ /dev/null
@@ -1,33 +0,0 @@
-import APIKey from './APIKey'
-
-# Your API Key
-
-<APIKey/>
-
-
-## Use API key
-
-To use the API key, you either:
-- **Set the API key as the `E2B_API_KEY` environment variable**
-- Or pass it directly to the `CodeInterpreter` constructor like this:
-<CodeGroup isRunnable={false}>
-```js {{ language: 'js' }}
-import { CodeInterpreter } from '@e2b/code-interpreter'
-
-const sandbox = await CodeInterpreter.create({ apiKey: 'YOUR_API_KEY' })
-await sandbox.notebook.execCell('x = 1')
-
-const execution = await sandbox.notebook.execCell('x+=1; x')
-console.log(execution.text) // outputs 2
-
-await sandbox.close()
-```
-```python {{ language: 'python' }}
-from e2b_code_interpreter import CodeInterpreter
-
-with CodeInterpreter(api_key="YOUR_API_KEY") as code_interpreter:
- sandbox.notebook.exec_cell("x = 1")
- execution = sandbox.notebook.exec_cell("x+=1; x")
- print(execution.text) # outputs 2
-```
-</CodeGroup>
diff --git a/apps/web/src/app/(docs)/docs/getting-started/installation/page.mdx b/apps/web/src/app/(docs)/docs/getting-started/installation/page.mdx
deleted file mode 100644
index 5d899c97e..000000000
--- a/apps/web/src/app/(docs)/docs/getting-started/installation/page.mdx
+++ /dev/null
@@ -1,28 +0,0 @@
-import { Libraries } from '@/components/Libraries'
-
-# Installation
-
-You create and control sandboxes with our SDKs.
-We offer SDKs for [JavaScript / TypeScript](https://www.npmjs.com/package/e2b), and [Python](https://pypi.org/project/e2b/).
-
-<Libraries/>
-
-You can install them using the following commands:
-
-<CodeGroup isRunnable={false}>
-```bash {{ language: 'js' }}
-npm install e2b
-```
-```bash {{ language: 'python' }}
-pip install e2b
-```
-</CodeGroup>
-
-
-## Next steps
-
-1. [Get your API key](/docs/getting-started/api-key)
-1. [Explore the Sandbox API](/docs/sandbox/api/envs)
-{/* 1. [Follow the "Hello World" example](/docs/guides/) */}
-{/* 1. [Check out the official guides](/docs/guides/overview) */}
-{/* 1. [Explore integrations with AI frameworks and LLMs](/docs/integrations/overview) */}
diff --git a/apps/web/src/app/(docs)/docs/guide/beta-code-interpreter-language-runtimes/page.mdx b/apps/web/src/app/(docs)/docs/guide/beta-code-interpreter-language-runtimes/page.mdx
deleted file mode 100644
index e7ed2d687..000000000
--- a/apps/web/src/app/(docs)/docs/guide/beta-code-interpreter-language-runtimes/page.mdx
+++ /dev/null
@@ -1,54 +0,0 @@
-# Code Interpreter SDK Beta - Language Runtimes
-
-This guide shows how to run AI-generated code in different language runtimes using the new Code Interpreter beta SDK.
-The following language runtimes are currently supported:
-- **Python**
-- **JavaScript**
-- **Java**
-- **Bash**
-- **R**
-
-<Note>
-Want more language runtimes? Reached out to us on [Discord](https://discord.gg/U7KEcGErtQ) or over [email](emailto:[email protected]).
-</Note>
-
-## 1. Install the Code Interpreter beta SDK
-The latest beta versions you should install can be found in NPM/PyPi release history:
-- **JavaScript & TypeScript**
- - [Latest release](https://www.npmjs.com/package/@e2b/code-interpreter?activeTab=versions) with *rc* tag for `@e2b/code-interpreter`
-- **Python**
- - [Latest release](https://pypi.org/project/e2b-code-interpreter/#history) with *PRE-RELEASE* for `e2b-code-interpreter`
-
-
-## 2. Active kernel for the desired language
-Each of the supported language runtimes has its own kernel.
-
-**Python**
-```python
-from e2b_code_interpreter import CodeInterpreter
-
-sandbox = CodeInterpreter()
-
-# 1. Set JS kernel - available kernel names: 'r', 'javascript', 'java', 'bash'
-js_id = sandbox.notebook.create_kernel(kernel_name="javascript")
-# 2. Run JS code inside code interpreter!
-execution = sandbox.notebook.exec_cell("console.log('Hello World!')", kernel_id=js_id)
-print(execution)
-# 3. Use Python again
-sandbox.notebook.exec_cell("print('Hello World!')")
-```
-
-**JavaScript / TypeScript**
-```js
-import { CodeInterpreter } from '@e2b/code-interpreter'
-
-const sandbox = await CodeInterpreter.create()
-
-// 1. Set JS kernel - available kernel names: 'r', 'javascript', 'java', 'bash'
-const jsID = await sandbox.notebook.createKernel({ kernelName: 'javascript' })
-// 2. Run JS code inside code interpreter!
-const execution = await sandbox.notebook.execCell("console.log('Hello World!')", { kernelID: jsID })
-console.log(execution)
-// 3. Use Python again
-await sandbox.notebook.execCell('print("Hello World!")')
-```
diff --git a/apps/web/src/app/(docs)/docs/guide/beta-migration/page.mdx b/apps/web/src/app/(docs)/docs/guide/beta-migration/page.mdx
deleted file mode 100644
index c5f71b909..000000000
--- a/apps/web/src/app/(docs)/docs/guide/beta-migration/page.mdx
+++ /dev/null
@@ -1,645 +0,0 @@
-# SDK Beta - Migration Guide
-The following guide shows how to migrate your code from the current Core SDKs (`e2b`) and Code Interpreter SDKs (`@e2b/code-interpreter`/`e2b-code-interpreter`) to the beta versions.
-
-The latest beta versions you should install can be found in NPM/PyPi release history:
-- **JavaScript & TypeScript**
- - [Latest release](https://www.npmjs.com/package/e2b?activeTab=versions) with *rc* tag for `e2b`
- - [Latest release](https://www.npmjs.com/package/@e2b/code-interpreter?activeTab=versions) with *rc* tag for `@e2b/code-interpreter`
-- **Python**
- - [Latest release](https://pypi.org/project/e2b/#history) with *PRE-RELEASE* for `e2b`
- - [Latest release](https://pypi.org/project/e2b-code-interpreter/#history) with *PRE-RELEASE* for `e2b-code-interpreter`
-
-## Table of contents
-- [Core Sandbox SDK changes](#core-sandbox-sdk-changes)
- - [Creating sandbox](#creating-sandbox)
- - [Modifying sandbox timeout](#modifying-sandbox-timeout)
- - [Reconnecting](#reconnecting)
- - [Uploading data and creating files in sandbox](#uploading-data-and-creating-files-in-sandbox)
- - [Downloading files and reading files in sandbox](#downloading-files-and-reading-files-in-sandbox)
- - [Running processes](#running-processes)
- - [Watching for files' changes](#watching-for-files-changes)
- - [Accessing sandbox ID](#accessing-sandbox-id)
- - [Getting sandbox upload URL](#getting-sandbox-upload-url)
- - [Configuring sandbox `cwd`](#configuring-sandbox-cwd)
- - [Timeouts](#timeouts)
- - [Listing sandboxes](#listing-sandboxes)
- - [Getting sandbox url](#getting-sandbox-url)
-- [Code Interpreter SDK changes](#code-interpreter-sdk-changes)
- - [Executing code](#executing-code)
- - [Custom template](#custom-template)
-- [Python Async](#python-async)
- - [Watching for files' changes in async Python SDK](#watching-for-files-changes-in-async-python-sdk)
- - [Running background commands in async Python SDK](#running-background-commands-in-async-python-sdk)
-
-
-## <h1>Core Sandbox SDK changes</h1>
-These changes affect both the `e2b` Core SDKs and Code Interpreter SDKs (`@e2b/code-interpreter`/`e2b-code-interpreter`) because the Code Interpreter uses the Core SDK.
-
-<Note>
-If you are using a custom template you need to rebuild it by calling `e2b template build` in the directory with the template.
-</Note>
-
-## Creating sandbox
-
-When creating a sandbox you now **specify the sandbox timeout — how long the sandbox will exist**. If you don't specify the timeout the sandbox will be closed after 5 minutes.
-
-You also no longer call the `.close()` method when you are done with the sandbox. Sandbox will be automatically closed and killed after the timeout.
-
-You can use `.kill()` to kill the sandbox immediately if you are sure you won't need it anymore.
-
-<CodeGroup isRunnable={false}>
-```js
-import Sandbox from 'e2b'
-
-// Before
-// const sandbox = await Sandbox.create()
-// await sandbox.close()
-
-// Now
-const sandbox = await Sandbox.create({ timeoutMs: 300_000 })
-```
-```python
-from e2b import Sandbox
-
-# Before
-# sandbox = Sandbox()
-# sandbox.close()
-
-# Now
-sandbox = Sandbox(timeout=300)
-```
-</CodeGroup>
-
-If you need to use a [custom sandbox template](/docs/guide/custom-sandbox) you pass the template as the first parameter:
-<CodeGroup isRunnable={false}>
-```js
-import Sandbox from 'e2b'
-
-// Before
-// const sandbox = await Sandbox.create({ template: 'template-name-or-id' })
-// await sandbox.close()
-
-// Now
-const sandbox = await Sandbox.create('template-name-or-id', {
- timeoutMs: 300_000,
-})
-```
-```python
-from e2b import Sandbox
-
-# Before
-# sandbox = Sandbox(template='template-name-or-id')
-# sandbox.close()
-
-# Now
-sandbox = Sandbox(template='template-name-or-id', timeout=300)
-```
-</CodeGroup>
-
-## Modifying sandbox timeout
-If you need to change how long the sandbox should stay alive after it was created, you can use `.setTimeout()`/`.set_timeout()` method.
-It will modify the timeout of the sandbox.
-
-<CodeGroup isRunnable={false}>
-```js
-import Sandbox from 'e2b'
-
-// Before
-// const sandbox = await Sandbox.create()
-// await sandbox.keepAlive(600_000)
-
-// Now
-const sandbox = await Sandbox.create({ timeoutMs: 300_000 })
-await sandbox.setTimeout(600_000)
-```
-```python
-from e2b import Sandbox
-
-# Before
-# sandbox = Sandbox()
-# sandbox.keep_alive(600)
-
-# Now
-sandbox = Sandbox(timeout=300)
-sandbox.set_timeout(600)
-```
-</CodeGroup>
-
-## Reconnecting
-When connection to an existing sandbox use `.connect()`/`.connect()` method instead of `.reconnect()`/`.reconnect()`.
-
-Instead of using `.keepAlive()`/`.keep_alive()` method to prevent the sandbox from closing until you reconnect use `.setTimeout()`/`.set_timeout()` method.
-Because the timeout is set when the sandbox is created, you may not need to set the timeout when reconnecting at all now.
-
-<CodeGroup isRunnable={false}>
-```js
-import Sandbox from 'e2b'
-
-// Before
-// const sandbox = await Sandbox.create()
-// await sandbox.keepAlive(600_000)
-// await sandbox.close()
-
-// const existingSandbox = await Sandbox.reconnect(sandbox.id)
-
-// Now
-const sandbox = await Sandbox.create({ timeoutMs: 600_000 })
-
-const existingSandbox = await Sandbox.connect(sandbox.sandboxId)
-```
-```python
-from e2b import Sandbox
-
-# Before
-# sandbox = Sandbox()
-# sandbox.keep_alive(600)
-# sandbox.close()
-
-# existing_sandbox = Sandbox.reconnect(sandbox.id)
-
-# Now
-sandbox = Sandbox(timeout=600)
-
-existing_sandbox = Sandbox.connect(sandbox.sandbox_id)
-```
-</CodeGroup>
-
-## Uploading data and creating files in sandbox
-Use `.files.write()` method to upload files to the sandbox.
-
-The method accepts `path` in the sandbox as the first argument and the `data` as the second argument.
-
-<CodeGroup isRunnable={false}>
-```js
-import Sandbox from 'e2b'
-
-// Before
-// const content = fs.readFileSync('/local/path')
-// await sandbox.uploadFile(content, '/path/in/sandbox')
-
-// Now
-const content = fs.readFileSync('/local/path')
-await sandbox.files.write('/path/in/sandbox', content)
-```
-```python
-from e2b import Sandbox
-
-# Before
-# with open("path/to/local/file", "rb") as file:
-# sandbox.upload_file(file)
-
-# Now
-with open("path/to/local/file", "rb") as file:
- sandbox.files.write("/path/in/sandbox", file)
-```
-</CodeGroup>
-
-## Downloading files and reading files in sandbox
-Use `.files.read()` method to download files from the sandbox.
-
-The method accepts `path` in the sandbox as the first argument and optional `format` as the second argument.
-
-<CodeGroup isRunnable={false}>
-```js
-import Sandbox from 'e2b'
-
-// Before
-//const content = await sandbox.downloadFile('/path/in/sandbox')
-
-// Now
-const content = await sandbox.files.read('/path/in/sandbox')
-```
-```python
-from e2b import Sandbox
-
-# Before
-# content = sandbox.download_file('/path/in/sandbox')
-
-# Now
-content = sandbox.files.read("/path/in/sandbox")
-```
-</CodeGroup>
-
-
-## Running processes
-You execute processes by calling `.commands.run()` method. By default, the method waits for the command to finish.
-
-You can specify the timeout for the command execution by passing `timeoutMs`/`timeout` option. The default timeout is 60 seconds.
-
-If the command fails with a non-zero exit it will raise `ProcessExitError` in Javascript, or `ProcessExitException` in Python, and you can catch and inspect the error for more info.
-
-<CodeGroup isRunnable={false}>
-```js
-import Sandbox from 'e2b'
-
-// Before
-// const sandbox = await Sandbox.create()
-// const result = await sandbox.process.startAndWait({
-// cmd: 'echo "Hello, world!"',
-// onStderr: (msg) => console.log(msg.line),
-// onStdout: (msg) => console.log(msg.line),
-// })
-
-// Now
-const result = await sandbox.commands.run('echo "Hello, World!"', {
- onStderr(output) { console.log(output) },
- onStdout(output) { console.log(output) },
- timeoutMs: 60_000,
-})
-```
-```python
-from e2b import Sandbox
-
-# Before
-# sandbox = Sandbox()
-# result = sandbox.process.start_and_wait(
-# cmd='echo "Hello, world!"',
-# on_stderr=lambda msg: print(msg.line),
-# on_stdout=lambda msg: print(msg.line),
-# )
-
-# Now
-result = sandbox.commands.run(
- cmd='echo "Hello, World!"',
- timeout=60,
- on_stdout=lambda output: print(output),
- on_stderr=lambda output: print(output),
-)
-```
-</CodeGroup>
-If you want to run the command in the background use `background: true`/`background=True` option.
-You can then use `.wait()` method to wait for the command to finish.
-
-<CodeGroup isRunnable={false}>
-```js
-import Sandbox from 'e2b'
-
-// Before
-// const sandbox = await Sandbox.create()
-// const process = await sandbox.process.start({
-// cmd: 'sleep 10; echo "Hello, world!"',
-// onStderr: (msg) => console.log(msg.line),
-// onStdout: (msg) => console.log(msg.line),
-// })
-
-// const result = await process.wait()
-
-// Now
-const command = await sandbox.commands.run('sleep 10; echo "Hello, world!"', {
- onStderr(output) { console.log(output) },
- onStdout(output) { console.log(output) },
- background: true,
-})
-
-const result = await command.wait()
-```
-```python
-from e2b import Sandbox
-
-# Before
-# sandbox = Sandbox()
-# process = sandbox.process.start(
-# cmd='echo "Hello, world!"',
-# on_stderr=lambda msg: print(msg.line),
-# on_stdout=lambda msg: print(msg.line),
-# )
-
-# result = process.wait()
-
-# Now
-command = sandbox.commands.run(
- cmd='echo "Hello, World!"',
- background=True,
-)
-
-result = command.wait(
- on_stderr=lambda output: print(output),
- on_stdout=lambda output: print(output),
-)
-```
-</CodeGroup>
-
-
-## Watching for files' changes
-
-<CodeGroup isRunnable={false}>
-```js
-import Sandbox from 'e2b'
-
-// Before
-// const sandbox = await Sandbox.create()
-// const watcher = sandbox.filesystem.watchDir('/path/in/sandbox')
-// watcher.addEventListener((event) => console.log(event))
-// await watcher.start()
-
-// Now
-const sandbox = await Sandbox.create()
-await sandbox.files.watch('/path/in/sandbox', (event) => console.log(event))
-```
-```python
-from e2b import Sandbox
-
-# Before
-# sandbox = Sandbox()
-
-# watcher = sandbox.filesystem.watch_dir("/path/in/sandbox")
-# watcher.add_event_listener(lambda event: print(event))
-# watcher.start()
-
-# Now
-sandbox = Sandbox()
-watcher = sandbox.files.watch("/path/in/sandbox")
-
-for event in watcher:
- print(event)
-```
-</CodeGroup>
-
-## Accessing sandbox ID
-The `id` property on the sandbox/code interpreter instance is now named `sandboxId`/`sandbox_id`.
-
-<CodeGroup isRunnable={false}>
-```js
-import Sandbox from 'e2b'
-
-// Before
-// const sandboxId = await sandbox.id
-
-// Now
-const sandboxId = await sandbox.sandboxId
-```
-```python
-from e2b import Sandbox
-
-# Before
-# sandbox_id = sandbox.id
-
-# Now
-sandbox_id = sandbox.sandbox_id
-```
-</CodeGroup>
-
-## Getting sandbox upload URL
-The `.fileURL`/`.file_url()` is now `.uploadURL`/`.upload_url()` method that takes an optional argument that specifies the path in the sandbox where the file will be uploaded.
-
-If the path is not specified the file will be uploaded to the home dir — `/home/user`.
-
-<CodeGroup isRunnable={false}>
-```js
-import Sandbox from 'e2b'
-
-// Before
-// const url = await sandbox.fileURL
-
-// Now
-const url = await sandbox.uploadUrl('/path/in/sandbox')
-```
-```python
-from e2b import Sandbox
-
-# Before
-# url = sandbox.file_url()
-
-# Now
-url = sandbox.upload_url('/path/in/sandbox')
-```
-</CodeGroup>
-
-## Configuring sandbox `cwd`
-Previously you could set the sandbox working directory by passing `cwd` option when creating the sandbox.
-Right now this is not supported because it leads to subtle bugs especially when reconnecting to an existing sandbox.
-
-If you need this feature please reach out to us on [Discord](https://discord.com/invite/U7KEcGErtQ) or [GitHub](https://github.com/e2b-dev/e2b) so we can prioritize it.
-
-## Timeouts
-There are now two types of timeouts that you can pass as parameters:
-1. `request_timeout`/`requestTimeoutMs` sets how long the operation should wait for connection/processing.
-This is useful for ensuring that none of the sandbox operations hang indefinitely.
-2. `timeout`/`timeoutMs` which is used for setting the maximum length of long-running operations like executing code, running processes, or the sandbox itself.
-
-## Listing sandboxes
-Some properties returned from the `Sandbox.list` method have been renamed.
-
-<CodeGroup isRunnable={false}>
-```js
-import Sandbox from 'e2b'
-
-// Before
-// const sandboxes = await Sandbox.list()
-
-// `sandboxes` is an array of `RunningSandbox` objects:
-// {
-// sandboxID: string
-// templateID: string
-// alias?: string
-// metadata?: SandboxMetadata
-// startedAt: Date
-// }
-
-// Now
-const sandboxes = await Sandbox.list()
-
-// `sandboxes` is an array of `SandboxInfo` objects:
-// {
-// sandboxId: string
-// templateId: string
-// name?: string
-// metadata: Record<string, string>
-// startedAt: Date
-// }
-```
-```python
-from e2b import Sandbox
-
-# Before
-# sandboxes = Sandbox.list()
-
-# `sandboxes` is an array of `RunningSandbox` objects:
-# class RunningSandbox(BaseModel):
-# sandbox_id: str
-# template_id: str
-# alias: Optional[str]
-# metadata: Optional[Dict[str, str]]
-# cpu_count: int
-# memory_mb: int
-# started_at: datetime
-
-# Now
-sandboxes = Sandbox.list()
-
-# `sandboxes` is an array of `SandboxInfo` objects:
-# @dataclass
-# class SandboxInfo:
-# sandbox_id: str
-# template_id: str
-# name: Optional[str]
-# metadata: Dict[str, str]
-# started_at: datetime
-
-```
-</CodeGroup>
-
-
-## Getting sandbox url
-The method for getting the sandbox host has changed from `sandbox.getHostname/sandbox.get_hostname` to `sandbox.getHost/sandbox.get_host`.
-It now requires specifying the port.
-
-<CodeGroup isRunnable={false}>
-```js
-import Sandbox from 'e2b'
-
-// Before
-// const host = await sandbox.getHostname(80)
-
-// Now
-const host = await sandbox.getHost(80)
-```
-```python
-from e2b import Sandbox
-
-# Before
-# host = sandbox.get_hostname(80)
-
-# Now
-host = sandbox.get_host(80)
-```
-</CodeGroup>
-
-
-## <h1>Code Interpreter SDK changes</h1>
-All the previously mentioned changes to the Core SDK also apply to the Code Interpreter SDK.
-Apart from them, the changes to the Code Interpreter SDK are very minimal:
-
-## Executing code
-When executing code via JS/TS Code Interpreter SDK you now pass the `timeoutMs` option to the `execCell` method instead of `timeout`.
-
-The default timeout for the code execution is now 300 seconds.
-
-<CodeGroup isRunnable={false}>
-```js
-import CodeInterpreter from '@e2b/code-interpreter'
-
-// Before
-// const sandbox = await CodeInterpreter.create()
-// const execution = await sandbox.notebook.execCell('print("Hello, world!")', {
-// timeout: 2000,
-// })
-// await sandbox.close()
-
-// Now
-const sandbox = await CodeInterpreter.create({ timeoutMs: 300_000 })
-const execution = await sandbox.notebook.execCell('print("Hello, world!")', {
- timeoutMs: 2000,
-})
-```
-
-```python
-from e2b_code_interpreter import CodeInterpreter
-
-# Before
-# sandbox = CodeInterpreter()
-# execution = sandbox.notebook.exec_cell('print("Hello, world!")', timeout=2)
-# sandbox.close()
-
-# Now
-sandbox = CodeInterpreter(timeout=300)
-execution = sandbox.notebook.exec_cell('print("Hello, world!")', timeout=2)
-```
-</CodeGroup>
-
-## Custom template
-If you are using a custom template for the Code Interpreter you need to rebuild it.
-
-
-You can rebuild the template by either calling
-```sh
-e2b template build -c "/root/.jupyter/start-up.sh"
-```
-if you use the E2B Docker image as base in your `e2b.Dockerfile`
-```docker
-FROM e2bdev/code-interpreter:latest
-
-# You custom Dockerfile content here
-```
-
-Or if you are using custom base you need to copy all files excluding the `e2b.toml` from [beta template](https://github.com/e2b-dev/code-interpreter/tree/beta/template)
-to the directory with your template and then run `e2b template build -c "/root/.jupyter/start-up.sh"`.
-
-<Note>
-Check of the [Code Interpreter custom template](/docs/code-interpreter/template) page for more info.
-</Note>
-
-## <h1>Python Async</h1>
-Python Core SDK and Code Interpter SDK now support async.
-
-If you need to use async import `AsyncSandbox`/`AsyncCodeInterpreter` instead of `Sandbox`/`CodeInterpreter`.
-
-<CodeGroup isRunnable={false}>
-```python
-# Sync
-# from e2b import Sandbox
-# sandbox = Sandbox()
-
-# from e2b_code_interpreter import CodeInterpreter
-# sandbox = CodeInterpreter()
-
-# Async
-from e2b import AsyncSandbox
-from e2b_code_interpreter import AsyncCodeInterpreter
-
-sandbox = await AsyncSandbox.create()
-sandbox = await AsyncCodeInterpreter.create()
-```
-</CodeGroup>
-
-The async versions of methods for watching for files' changes and running commands in the background are slightly different:
-
-## Watching for files' changes in async Python SDK
-
-<CodeGroup isRunnable={false}>
-```python
-from e2b import Sandbox
-
-# Sync
-# sandbox = Sandbox()
-# watcher = sandbox.files.watch("/path/in/sandbox")
-
-# for event in watcher:
-# print(event)
-
-# Async
-sandbox = await AsyncSandbox.create()
-
-await sandbox.files.watch("/path/in/sandbox", lambda event: print(event))
-```
-</CodeGroup>
-
-## Running background commands in async Python SDK
-<CodeGroup isRunnable={false}>
-```python
-from e2b import Sandbox
-
-# Sync
-# sandbox = Sandbox()
-# command = sandbox.commands.run(
-# cmd='echo "Hello, World!"',
-# background=True,
-# )
-
-# result = command.wait(
-# on_stderr=lambda output: print(output),
-# on_stdout=lambda output: print(output),
-# )
-
-# Async
-sandbox = await AsyncSandbox.create()
-command = await sandbox.commands.run(
- cmd='echo "Hello, World!"',
- on_stderr=lambda output: print(output),
- on_stdout=lambda output: print(output),
- background=True,
-)
-
-result = await command.wait()
-```
-</CodeGroup>
diff --git a/apps/web/src/app/(docs)/docs/guide/connect-bucket/page.mdx b/apps/web/src/app/(docs)/docs/guide/connect-bucket/page.mdx
deleted file mode 100644
index 2261b05b1..000000000
--- a/apps/web/src/app/(docs)/docs/guide/connect-bucket/page.mdx
+++ /dev/null
@@ -1,185 +0,0 @@
-# Connecting bucket to the sandbox
-
-To enable persistence of the data in the sandbox we can use a bucket to store the data. We are leveraging the fuse file system to mount the bucket to the sandbox.
-
-You will need to build a custom sandbox template with the fuse file system installed. The guide how to build a custom sandbox template can be found [here](/docs/guide/custom-sandbox).
-
-## Google Cloud Storage
-
-### Prerequisites
-
-To use the Google Cloud Storage we'll need to have a bucket and a service account. The service account can be created [here](https://console.cloud.google.com/iam-admin/serviceaccounts), the bucket can be created [here](https://console.cloud.google.com/storage).
-
-If you want to write to the bucket the service account must have the `Storage Object Admin` role for this bucket.
-
-The guide how to create a service account key can be found [here](https://cloud.google.com/iam/docs/keys-create-delete#iam-service-account-keys-create-console).
-
-### Mounting the bucket
-
-To use the Google Cloud Storage we need to install the `gcsfuse` package. There's simple `Dockerfile` that can be used to create a container with the `gcsfuse` installed.
-
-```docker
-FROM ubuntu:latest
-
-RUN apt-get update && apt-get install -y gnupg lsb-release wget
-
-RUN lsb_release -c -s > /tmp/lsb_release
-RUN GCSFUSE_REPO=$(cat /tmp/lsb_release); echo "deb https://packages.cloud.google.com/apt gcsfuse-$GCSFUSE_REPO main" | tee /etc/apt/sources.list.d/gcsfuse.list
-RUN wget -O - https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -
-
-RUN apt-get update && apt-get install -y gcsfuse
-
-```
-
-The actual mounting of the bucket is done in runtime during the start of the sandbox. The `gcsfuse` command is used to mount the bucket to the sandbox.
-
-<CodeGroup isRunnable={false}>
-```js {{ language: 'js' }}
-import { Sandbox } from 'e2b'
-
-const sandbox = await Sandbox.create({ template: '<your template id>' })
-await sandbox.filesystem.makeDir("/home/user/bucket")
-await sandbox.uploadFile("key.json")
-
-const process = await sandbox.process.start("sudo gcsfuse <flags> --key-file /home/user/key.json <bucket-name> /home/user/bucket")
-const output = await process.wait()
-if (output.exitCode) {
- throw Error(output.stderr)
-}
-```
-
-```python {{ language: 'python' }}
-from e2b import Sandbox
-
-with Sandbox(template="<your template id>") as sandbox:
- sandbox.filesystem.make_dir("/home/user/bucket")
- sandbox.upload_file("key.json")
-
- process = sandbox.process.start("sudo gcsfuse <flags> --key-file /home/user/key.json <bucket-name> /home/user/bucket")
- output = process.wait()
- if output.exit_code:
- raise Exception(output.stderr)
-
-```
-</CodeGroup>
-
-### Flags
-
-The list of all flags can be found [here](https://cloud.google.com/storage/docs/gcsfuse-cli#options).
-
-### Allow the default user to access the files
-
-To allow the default user to access the files we can use the following flags:
-
-```
--o allow_other -file-mode=777 -dir-mode=777
-```
-
-## Amazon S3
-
-For Amazon S3 we can use the `s3fs` package. The `Dockerfile` is similar to the one for the Google Cloud Storage.
-
-```docker
-FROM ubuntu:latest
-
-RUN apt-get update && apt-get install s3fs
-```
-
-Similarly to the Google Cloud Storage, the actual mounting of the bucket is done in runtime during the start of the sandbox. The `s3fs` command is used to mount the bucket to the sandbox.
-
-<CodeGroup isRunnable={false}>
-```js {{ language: 'js' }}
-import { Sandbox } from 'e2b'
-
-const sandbox = await Sandbox.create({ template: '<your template id>' })
-await sandbox.filesystem.makeDir('/home/user/bucket')
-
-
-// Create a file with the credentials
-// If you use another path for the credentials you need to add the path in the command s3fs command
-await sandbox.filesystem.write('/root/.passwd-s3fs', '<AWS_ACCESS_KEY_ID>:<AWS_SECRET_ACCESS_KEY>')
-await sandbox.process.startAndWait('sudo chmod 600 /root/.passwd-s3fs')
-
-const process = await sandbox.process.start('sudo s3fs <flags> <bucket-name> /home/user/bucket')
-const output = await process.wait()
-if (output.exitCode) {
- throw Error(output.stderr)
-}
-```
-
-```python {{ language: 'python' }}
-from e2b import Sandbox
-
-with Sandbox(template="<your template id>") as sandbox:
- sandbox.filesystem.make_dir("/home/user/bucket")
-
- # Create a file with the credentials
- # If you use another path for the credentials you need to add the path in the command s3fs command
- sandbox.filesystem.write("/root/.passwd-s3fs", "<AWS_ACCESS_KEY_ID>:<AWS_SECRET_ACCESS_KEY>")
- sandbox.process.start_and_wait("sudo chmod 600 /root/.passwd-s3fs")
-
- process = sandbox.process.start("sudo s3fs <flags> <bucket-name> /home/user/bucket")
- output = process.wait()
- if output.exit_code:
- raise Exception(output.stderr)
-
-```
-</CodeGroup>
-
-### Flags
-
-The list of all flags can be found [here](https://manpages.ubuntu.com/manpages/xenial/man1/s3fs.1.html).
-
-### Allow the default user to access the files
-
-To allow the default user to access the files add the following flag:
-
-```
--o allow_other
-```
-
-## Cloudflare R2
-
-For Cloudflare R2 we can use very similar setup as for S3. The `Dockerfile` is the same as for S3. The mounting is slightly different, we need to specify the endpoint for R2.
-
-<CodeGroup isRunnable={false}>
-```js {{ language: 'js' }}
-
-import { Sandbox } from 'e2b'
-
-const sandbox = await Sandbox.create({ template: '<your template id>' })
-await sandbox.filesystem.makeDir('/home/user/bucket')
-
-// Create a file with the R2 credentials
-// If you use another path for the credentials you need to add the path in the command s3fs command
-await sandbox.filesystem.write('/root/.passwd-s3fs', '<R2_ACCESS_KEY_ID>:<R2_SECRET_ACCESS_KEY>')
-await sandbox.process.startAndWait('sudo chmod 600 /root/.passwd-s3fs')
-
-const output = await sandbox.process.startAndWait('sudo s3fs -o url=https://<ACCOUNT ID>.r2.cloudflarestorage.com <flags> <bucket-name> /home/user/bucket')
-if (output.exitCode) {
- throw Error(output.stderr)
-}
-```
-
-```python {{ language: 'python' }}
-from e2b import Sandbox
-
-with Sandbox(template="<your template id>") as sandbox:
- sandbox.filesystem.make_dir("/home/user/bucket")
-
- # Create a file with the R2 credentials
- # If you use another path for the credentials you need to add the path in the command s3fs command
- sandbox.filesystem.write("/root/.passwd-s3fs", "<R2_ACCESS_KEY_ID>:<R2_SECRET_ACCESS_KEY>")
- sandbox.process.start_and_wait("sudo chmod 600 /root/.passwd-s3fs")
-
- process = sandbox.process.start("sudo s3fs -o url=https://<ACCOUNT ID>.r2.cloudflarestorage.com <flags> <bucket-name> /home/user/bucket")
- output = process.wait()
- if output.exit_code:
- raise Exception(output.stderr)
-
-```
-</CodeGroup>
-
-### Flags
-
-It's the same as for S3.
\ No newline at end of file
diff --git a/apps/web/src/app/(docs)/docs/guide/custom-sandbox/page.mdx b/apps/web/src/app/(docs)/docs/guide/custom-sandbox/page.mdx
deleted file mode 100644
index 92453ed6e..000000000
--- a/apps/web/src/app/(docs)/docs/guide/custom-sandbox/page.mdx
+++ /dev/null
@@ -1,195 +0,0 @@
-import Image from 'next/image'
-
-# Creating Custom Sandbox
-
-In this guide, we'll create a custom E2B sandbox with preinstalled dependencies and files.
-Once the sandbox is built, we'll show how to spawn and control it with our SDK.
-
-## Prerequisites
-1. [Node.js](https://nodejs.org/) 18.0.0 or later
-1. [E2B CLI](/docs/cli/installation)
-1. Running Docker instance
-
-## 1. Install E2B CLI
-
-<CodeGroup isTerminalCommand title="Install CLI" isRunnable={false}>
-```bash
-npm install -g @e2b/cli@latest
-```
-</CodeGroup>
-
-<Note>
-You need Node.js 18.0.0 or later to install the CLI.
-</Note>
-
-## 2. Login to CLI
-Before you create your first custom sandbox, you will need to authenticate in the CLI with your E2B account.
-Run the following command in your terminal.
-<CodeGroup isTerminalCommand title="Login to CLI" isRunnable={false}>
-```bash
-e2b auth login
-```
-</CodeGroup>
-
-<Note>
-You need to have an existing E2B account to login. Sign up [here](/docs/getting-started/api-key).
-</Note>
-
-## 3. Create `e2b.Dockerfile`
-To describe how your custom sandbox will look like, create a new Dockerfile and name it `e2b.Dockerfile`.
-We use this Dockerfile as the [template file](/docs/sandbox/templates/template-file).
-
-<Note>
-Run `e2b template init` to create `e2b.Dockerfile` in the current directory.
-</Note>
-
-We want our custom sandbox to have the [ffmpeg](https://www.ffmpeg.org/) isntalled - ffmpeg is a tool for editing video and audio files.
-
-<Note>
-We support only Debian based images at the moment.
-</Note>
-
-<CodeGroup isFileName title="e2b.Dockerfile" isRunnable={false}>
-```bash
-# You can use most of the Debian based images
-FROM ubuntu:22.04
-
-# Install the ffmpeg tool/
-RUN apt update \
- && apt install -y ffmpeg
-```
-</CodeGroup>
-
-## 4. Build custom sandbox
-Now it's time to create your custom sandbox based on the sandbox template file (the `e2b.Dockefile` file) you just created in the previous step.
-
-Run the following command inside the template file directory in your terminal.
-<Note>
-[Pro users](/docs/pricing) can use the `--cpu-count=` ([docs](/docs/cli/commands#template-build)) and `--memory-mb=` ([docs](/docs/cli/commands#template-build)) flags to customize the sandbox compute.
-Read more about the compute [here](/docs/sandbox/compute).
-</Note>
-
-<CodeGroup isTerminalCommand title="Build sandbox template" isRunnable={false}>
-```bash
-e2b template build --name "my-agent-sandbox"
-```
-</CodeGroup>
-
-<Note>
-Use the `.dockerignore` file to exclude files from the sandbox template.
-</Note>
-
-The final output should look similar to this.
-
-<CodeGroup title="Build output" isRunnable={false}>
-```bash
-Preparing sandbox template building (1 files in Docker build context).
-Found ./e2b.Dockerfile that will be used to build the sandbox template.
-Started building the sandbox template my-agent-sandbox
-
-# Truncated for visibility
-# ...
-# ...
-
-Running postprocessing. It can take up to few minutes.
-
-Postprocessing finished.
-
-✅ Building sandbox template my-agent-sandbox finished.
-
-┌ Usage examples ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
-│ │
-│ You can use E2B Python or JS SDK to spawn sandboxes now. │
-│ Find more here - https://e2b.dev/docs/guide/custom-sandbox in Spawn and control your sandbox section. │
-│ │
-│───────────────────────────────────────────────────────────────────── Python SDK ─────────────────────────────────────────────────────────────────────│
-│ │
-│ from e2b import Sandbox │
-│ │
-│ # Start sandbox │
-│ sandbox = Sandbox("my-agent-sandbox") │
-│ │
-│ # Interact with sandbox. Learn more here: │
-│ # https://e2b.dev/docs/sandbox/overview │
-│ │
-│ # Close sandbox once done │
-│ sandbox.close() │
-│ │
-│─────────────────────────────────────────────────────────────────────── JS SDK ───────────────────────────────────────────────────────────────────────│
-│ │
-│ import { Sandbox } from 'e2b' │
-│ │
-│ // Start sandbox │
-│ const sandbox = await Sandbox.create('my-agent-sandbox') │
-│ │
-│ // Interact with sandbox. Learn more here: │
-│ // https://e2b.dev/docs/sandbox/overview │
-│ │
-│ // Close sandbox once done │
-│ await sandbox.close() │
-│ │
-└──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
-
-Execution time: 42.55s
-```
-</CodeGroup>
-
-
-This will create the `e2b.toml` file storing the sandbox config.
-<CodeGroup isFileName title="e2b.toml" isRunnable={false}>
-```toml
-# This is a config for E2B sandbox template
-template_id = "1wdqsf9le9gk21ztb4mo"
-dockerfile = "e2b.Dockerfile"
-template_name = "my-agent-sandbox"
-```
-</CodeGroup>
-
-| Sandbox template name | Sandbox template ID |
----|---|
-|`my-agent-sandbox`|`1wdqsf9le9gk21ztb4mo`|
-
-### Updating your sandbox template
-If you want to update your sandbox template, you run the same command you did to build it.
-This will rebuild the template.
-
-<CodeGroup isTerminalCommand title="Update sandbox template" isRunnable={false}>
-```bash
-e2b template build
-```
-</CodeGroup>
-
-## 5. Spawn and control your sandbox
-
-Now you can use the [E2B SDK](/docs/getting-started/installation) to spawn & control your new custom sandbox.
-
-The sandbox template name is `my-agent-sandbox`. We'll use it as an unique identifier and pass it to the SDK as the `template` parameter.
-This way, we'll be able to spawn our custom sandbox and control it with the SDK.
-
-<CodeGroup title="Spawn & control your custom sandbox" isRunnable={true}>
-```js {{ language: 'js' }}
-import { Sandbox } from 'e2b'
-
-// Spawn your custom sandbox
-const sandbox = await Sandbox.create({ template: 'my-agent-sandbox' }) // $HighlightLine
-
-// Interact with sandbox. Learn more here:
-// https://e2b.dev/docs/sandbox/overview
-
-// Close sandbox once done
-await sandbox.close()
-```
-
-```python {{ language: 'python' }}
-from e2b import Sandbox
-
-# Spawn your custom sandbox
-sandbox = Sandbox(template="my-agent-sandbox") # $HighlightLine
-
-# Interact with sandbox. Learn more here:
-# https://e2b.dev/docs/sandbox/overview
-
-# Close sandbox once done
-sandbox.close()
-```
-</CodeGroup>
diff --git a/apps/web/src/app/(docs)/docs/hello-world/js/page.mdx b/apps/web/src/app/(docs)/docs/hello-world/js/page.mdx
deleted file mode 100644
index 0e650b5ef..000000000
--- a/apps/web/src/app/(docs)/docs/hello-world/js/page.mdx
+++ /dev/null
@@ -1,308 +0,0 @@
-import Image from 'next/image'
-import imgChart from '@/images/hello-world-chart.png'
-
-# Hello World.ts
-This JavaScript guide will show you the basics of E2B:
-- Connect the code interpreter to an LLM
-- Prompt the LLM to generate the Python code
-- Execute the AI-generated Python code in a secure E2B sandbox
-
-### Get full code
-Check out the [full code in our cookbook](https://github.com/e2b-dev/e2b-cookbook/tree/main/examples/hello-world-js).
-
-### Overview
-1. [Install Code Interpreter SDK](#1-install-code-interpreter-sdk)
-1. [Prepare prompt and tools for LLM](#2-prepare-prompt-and-tools-for-llm)
-1. [Prepare code interpreting](#3-prepare-code-interpreting)
-1. [Call LLM and parse response with tools](#4-call-llm-and-parse-response-with-tools)
-1. [Create code interpreter and run everything](##5-create-code-interpreter-and-run-everything)
-1. [Save generated chart](#6-save-generated-chart)
-
-
-## 1. Install Code Interpreter SDK
-
-The Code Interpreter SDK allows you to run AI-generated code in a secure small VM - **E2B sandbox** - made for AI code execution.
-Inside the sandbox is a Jupyter server running that you can control from our SDK through the `notebook.execCell()` method.
-
-Check out the [SDK's repository on GitHub](https://github.com/e2b-dev/code-interpreter).
-
-<CodeGroup isRunnable={false}>
-```bash {{ language: 'javascript' }}
-npm init -y \
-&& npm i --save-dev typescript tsx @types/node \
-&& npm i @e2b/code-interpreter
-```
-</CodeGroup>
-
-Get your E2B API key [here](/docs/getting-started/api-key) and save it to `.env` in your root directory.
-<CodeGroup isFileName title=".env" isRunnable={false}>
-```bash
-E2B_API_KEY="e2b-api-key"
-```
-</CodeGroup>
-
-## 2. Prepare prompt and tools for LLM
-We'll be using Anthropic's [Claude 3 Opus](https://www.anthropic.com/news/claude-3-family) model but E2B works with any LLM so feel free to pick any you want!
-
-<Note>
-Usually, all you need from the model is just support for tool use. If the LLM doesn't support tool use, you can ask the LLM to respond with Markdown or XML and parse the LLM's output on your own. Then just pass the parsed code from code blocks to the code interpreter.
-</Note>
-
-Create the `model.ts` file and paste the following code.
-<CodeGroup isFileName title="model.ts" isRunnable={false}>
-```ts
-import { Tool } from '@anthropic-ai/sdk/src/resources/beta/tools'
-
-export const MODEL_NAME = 'claude-3-opus-20240229'
-
-export const SYSTEM_PROMPT = `
-## your job & context
-you are a python data scientist. you are given tasks to complete and you run python code to solve them.
-- the python code runs in jupyter notebook.
-- every time you call \`execute_python\` tool, the python code is executed in a separate cell. it's okay to multiple calls to \`execute_python\`.
-- display visualizations using matplotlib or any other visualization library directly in the notebook. don't worry about saving the visualizations to a file.
-- you have access to the internet and can make api requests.
-- you also have access to the filesystem and can read/write files.
-- you can install any pip package (if it exists) if you need to but the usual packages for data analysis are already preinstalled.
-- you can run any python code you want, everything is running in a secure sandbox environment.
-`
-
-export const tools: Tool[] = [
- {
- name: 'execute_python',
- description: 'Execute python code in a Jupyter notebook cell and returns any result, stdout, stderr, display_data, and error.',
- input_schema: {
- type: 'object',
- properties: {
- code: {
- type: 'string',
- description: 'The python code to execute in a single cell.'
- }
- },
- required: ['code']
- }
- }
-]
-
-```
-</CodeGroup>
-
-This defines our system prompt and the `tools` dictionary with available tools for the LLM - namely the `"execute_python"` tool.
-A little bit later, we'll connect `"execute_python"` to the E2B's code interpretrer.
-
-
-## 3. Prepare code interpreting
-We'll create a new function called `codeInterpret()` in a separate file `codeInterpreter.ts`.
-
-<CodeGroup isFileName title="codeInterpreter.ts" isRunnable={false}>
-```ts {{ language: 'javascript' }}
-import { CodeInterpreter } from '@e2b/code-interpreter'
-
-export async function codeInterpret(codeInterpreter: CodeInterpreter, code: string) {
- console.log(`\n${'='.repeat(50)}\n> Running following AI-generated code:\n${code}\n${'='.repeat(50)}`);
-
- const exec = await codeInterpreter.notebook.execCell(
- code,
- {
- // You can stream logs from the code interpreter
- // onStderr: (stderr: string) => console.log("\n[Code Interpreter stdout]", stderr),
- // onStdout: (stdout: string) => console.log("\n[Code Interpreter stderr]", stdout),
- //
- // You can also stream additional results like charts, images, etc.
- // onResult: ...
- }
- )
-
- if (exec.error) {
- console.log('[Code Interpreter error]', exec.error) // Runtime error
- return undefined
- }
-
- return exec
-}
-```
-</CodeGroup>
-
-This function takes the `CodeInterpreter` object from our SDK, and `code` as paramaters.
-The `code` parameter is the code generated by the LLM.
-
-Inside the function, we call the `codeInterpreter.notebook.execCell()` method. The `execCell()` takes `code` argument, and executes this `code` inside E2B sandbox.
-
-## 4. Call LLM and parse response with tools
-We're using Claude 3 Opus. Get your [Anthropic API key](https://console.anthropic.com/), save it to `.env` file, and install the [Anthropic SDK](https://docs.anthropic.com/claude/reference/client-sdks).
-
-<CodeGroup isFileName title=".env" isRunnable={false}>
-```bash
-ANTHROPIC_API_KEY="anthropic-api-key"
-```
-</CodeGroup>
-
-<CodeGroup isRunnable={false}>
-```bash {{ language: 'python' }}
-npm i @anthropic-ai/sdk
-```
-</CodeGroup>
-
-Now we'll put everything together.
-Create the `index.ts` file, import dependencies, and create the `chat()` function that will do the LLM calling and tool parsing.
-
-<CodeGroup isFileName title="index.ts" isRunnable={false}>
-```ts {{ language: 'javascript' }}
-import * as fs from 'fs'
-
-import 'dotenv/config'
-import { CodeInterpreter, Execution } from '@e2b/code-interpreter'
-import Anthropic from '@anthropic-ai/sdk'
-
-import {
- MODEL_NAME,
- SYSTEM_PROMPT,
- tools,
-} from './model'
-import { codeInterpret } from './codeInterpreter'
-
-const anthropic = new Anthropic()
-
-async function chat(codeInterpreter: CodeInterpreter, userMessage: string): Promise<Execution | undefined> {
- console.log('Waiting for Claude...')
-
- const msg = await anthropic.beta.tools.messages.create({
- model: MODEL_NAME,
- system: SYSTEM_PROMPT,
- max_tokens: 4096,
- messages: [{role: 'user', content: userMessage}],
- tools,
- })
-
- console.log(`\n${'='.repeat(50)}\nModel response: ${msg.content}\n${'='.repeat(50)}`)
- console.log(msg)
-
- if (msg.stop_reason === 'tool_use') {
- const toolBlock = msg.content.find((block) => block.type === 'tool_use');
- const toolName = toolBlock.name
- const toolInput = toolBlock.input
-
- console.log(`\n${'='.repeat(50)}\nUsing tool: ${toolName}\n${'='.repeat(50)}`);
-
- if (toolName === 'execute_python') {
- const code = toolInput.code
- return codeInterpret(codeInterpreter, code)
- }
- return undefined
- }
-}
-```
-</CodeGroup>
-
-## 5. Create code interpreter and run everything
-Now we put all together, and run our program. In the end of `index.ts` add following code prompting the LLM to visualize a distribution of height of men and print the median.
-
-<CodeGroup isFileName title="index.ts" isRunnable={false}>
-```ts {{ language: 'javascript' }}
-async function run() {
- const userMessage = 'Visualize a distribution of height of men based on the latest data you know. Also print the median value.'
-
- const codeInterpreter = await CodeInterpreter.create()
-
- const codeOutput = await chat(codeInterpreter, userMessage)
- if (!codeOutput) {
- console.log('No code output')
- return
- }
-
- const logs = codeOutput.logs
- console.log(logs)
-
- if (codeOutput.results.length == 0) {
- console.log('No results')
- return
- }
-
- const firstResult = codeOutput.results[0]
- // Print description of the first rich result
- console.log(firstResult.text)
-
- await codeInterpreter.close()
-}
-
-run()
-```
-</CodeGroup>
-
-After running your code with the following command
-<CodeGroup isRunnable={false}>
-```bash {{ language: 'bash' }}
-$ tsx index.ts
-```
-</CodeGroup>
-
-you should see similar results to this:
-
-```sh
-stdout=['The median male height is 175.5 cm\n'] stderr=[]
-<Figure size 800x400 with 1 Axes>
-```
-
-We got our median in the logs (`stdout`, and `stderr`) but we also something intering in `firstResult`.
-```sh
-<Figure size 800x400 with 1 Axes>
-```
-
-## 6. Save generated chart
-
-This looks like a plot. Let's save it to a file. Update the `run()` function like this,
-and run the code again with `tsx index.ts` in your terminal.
-<CodeGroup isFileName title="index.ts" isRunnable={false}>
-```ts {{ language: 'javscript' }}
-async function run() {
- const userMessage = 'Visualize a distribution of height of men based on the latest data you know. Also print the median value.'
-
- const codeInterpreter = await CodeInterpreter.create()
-
- const codeOutput = await chat(codeInterpreter, userMessage)
- if (!codeOutput) {
- console.log('No code output')
- return
- }
-
- const logs = codeOutput.logs
- console.log(logs)
-
- if (codeOutput.results.length == 0) {
- console.log('No results')
- return
- }
-
- const firstResult = codeOutput.results[0]
- // Print description of the first rich result
- console.log(firstResult.text)
-
- // If we received a chart in PNG form, we can visualize it
- if (firstResult.png) {
- // Decode the base64 encoded PNG data
- const pngData = Buffer.from(firstResult.png, 'base64');
-
- // Generate a unique filename for the PNG
- const filename = 'chart.png';
-
- // Save the decoded PNG data to a file
- fs.writeFileSync(filename, pngData);
-
- console.log(`Saved chart to ${filename}`);
- }
-
- await codeInterpreter.close()
-}
-
-run()
-```
-</CodeGroup>
-
-The chart got saved in the `chart.png` file and it should look similar to this:
-
-<Image
- src={imgChart}
- className="rounded w-full"
- alt="Chart visualizing distribution height of men"
- unoptimized
-/>
\ No newline at end of file
diff --git a/apps/web/src/app/(docs)/docs/hello-world/py/page.mdx b/apps/web/src/app/(docs)/docs/hello-world/py/page.mdx
deleted file mode 100644
index 40bdda1f1..000000000
--- a/apps/web/src/app/(docs)/docs/hello-world/py/page.mdx
+++ /dev/null
@@ -1,253 +0,0 @@
-import Image from 'next/image'
-import imgChart from '@/images/hello-world-chart.png'
-
-
-# Hello World.py
-This Python guide will show you the basics of E2B:
-- Connect the code interpreter to an LLM
-- Prompt the LLM to generate the Python code
-- Execute the AI-generated Python code in a secure E2B sandbox
-
-### Get full code
-Check out the [full code in our cookbook](https://github.com/e2b-dev/e2b-cookbook/tree/main/examples/hello-world-python).
-
-### Overview
-1. [Install Code Interpreter SDK](#1-install-code-interpreter-sdk)
-1. [Prepare prompt and tools for LLM](#2-prepare-prompt-and-tools-for-llm)
-1. [Prepare code interpreting](#3-prepare-code-interpreting)
-1. [Call LLM and parse response with tools](#4-call-llm-and-parse-response-with-tools)
-1. [Create code interpreter and run everything](##5-create-code-interpreter-and-run-everything)
-1. [Save generated chart](#6-save-generated-chart)
-
-
-## 1. Install Code Interpreter SDK
-
-The Code Interpreter SDK allows you to run AI-generated code in a secure small VM - **E2B sandbox** - made for AI code execution.
-Inside the sandbox is a Jupyter server running that you can control from our SDK through the `notebook.execCell()` method.
-
-Check out the [SDK's repository on GitHub](https://github.com/e2b-dev/code-interpreter).
-
-<CodeGroup isRunnable={false}>
-```bash {{ language: 'python' }}
-pip install e2b_code_interpreter python-dotenv
-```
-</CodeGroup>
-
-Get your E2B API key [here](/docs/getting-started/api-key) and save it to `.env` in your root directory.
-<CodeGroup isFileName title=".env" isRunnable={false}>
-```bash
-E2B_API_KEY="e2b-api-key"
-```
-</CodeGroup>
-
-
-## 2. Prepare prompt and tools for LLM
-We'll be using Anthropic's [Claude 3 Opus](https://www.anthropic.com/news/claude-3-family) model but E2B works with any LLM so feel free to pick any you want!
-
-<Note>
-Usually, all you need from the model is just support for tool use. If the LLM doesn't support tool use, you can ask the LLM to respond with Markdown or XML and parse the LLM's output on your own. Then just pass the parsed code from code blocks to the code interpreter.
-</Note>
-
-Create the `model.py` file and paste the following code.
-<CodeGroup isFileName title="model.py" isRunnable={false}>
-```python
-MODEL_NAME = "claude-3-opus-20240229"
-
-SYSTEM_PROMPT = """
-## your job & context
-you are a python data scientist. you are given tasks to complete and you run python code to solve them.
-- the python code runs in jupyter notebook.
-- every time you call `execute_python` tool, the python code is executed in a separate cell. it's okay to multiple calls to `execute_python`.
-- display visualizations using matplotlib or any other visualization library directly in the notebook. don't worry about saving the visualizations to a file.
-- you have access to the internet and can make api requests.
-- you also have access to the filesystem and can read/write files.
-- you can install any pip package (if it exists) if you need to but the usual packages for data analysis are already preinstalled.
-- you can run any python code you want, everything is running in a secure sandbox environment.
-"""
-
-tools = [
- {
- "name": "execute_python",
- "description": "Execute python code in a Jupyter notebook cell and returns any result, stdout, stderr, display_data, and error.",
- "input_schema": {
- "type": "object",
- "properties": {
- "code": {
- "type": "string",
- "description": "The python code to execute in a single cell."
- }
- },
- "required": ["code"]
- }
- }
-]
-```
-</CodeGroup>
-
-This defines our system prompt and the `tools` dictionary with available tools for the LLM - namely the `"execute_python"` tool.
-A little bit later, we'll connect `"execute_python"` to the E2B's code interpreter.
-
-
-## 3. Prepare code interpreting
-We'll create a new function called `code_interpret()` in a separate file `code_interpreter.py`.
-
-<CodeGroup isFileName title="code_interpreter.py" isRunnable={false}>
-```python {{ language: 'python' }}
-from e2b_code_interpreter import CodeInterpreter
-
-def code_interpret(code_interpreter: CodeInterpreter, code: str):
- print(f"\n{'='*50}\n> Running following AI-generated code:\n{code}\n{'='*50}")
- exec = code_interpreter.notebook.exec_cell(
- code,
- # You can stream logs from the code interpreter
- # on_stderr=lambda stderr: print("\n[Code Interpreter stdout]", stderr),
- # on_stdout=lambda stdout: print("\n[Code Interpreter stderr]", stdout),
- #
- # You can also stream additional results like charts, images, etc.
- # on_result=...
- )
-
- if exec.error:
- print("[Code Interpreter error]", exec.error) # Runtime error
- else:
- return exec.results, exec.logs
-```
-</CodeGroup>
-
-This function takes the `CodeInterpreter` object from our SDK and `code` as paramaters.
-The `code` parameter is the code generated by the LLM.
-
-Inside the function, we call the `code_interpreter.notebook.exec_cell()` method. The `exec_cell()` takes the `code` argument and executes this `code` inside E2B sandbox.
-
-## 4. Call LLM and parse response with tools
-We're using Claude 3 Opus. Get your [Anthropic API key](https://console.anthropic.com/), save it to `.env` file, and install the [Anthropic SDK](https://docs.anthropic.com/claude/reference/client-sdks).
-
-<CodeGroup isFileName title=".env" isRunnable={false}>
-```bash
-ANTHROPIC_API_KEY="anthropic-api-key"
-```
-</CodeGroup>
-
-<CodeGroup isRunnable={false}>
-```bash {{ language: 'python' }}
-pip install anthropic
-```
-</CodeGroup>
-
-Now we'll put everything together.
-Create the `main.py` file, import dependencies, and create the `chat()` function that will do the LLM calling and tool parsing.
-
-<CodeGroup isFileName title="main.py" isRunnable={false}>
-```python {{ language: 'python' }}
-import base64
-from dotenv import load_dotenv
-from anthropic import Anthropic
-from typing import List, Tuple
-from e2b_code_interpreter import CodeInterpreter, Result
-from e2b_code_interpreter.models import Logs
-
-from e2b_hello_world.model import MODEL_NAME, SYSTEM_PROMPT, tools
-from e2b_hello_world.code_interpreter import code_interpret
-
-# Load the .env file
-load_dotenv()
-
-client = Anthropic()
-
-def chat(code_interpreter: CodeInterpreter, user_message: str) -> Tuple[List[Result], Logs]:
- print(f"\n{'='*50}\nUser Message: {user_message}\n{'='*50}")
-
- message = client.beta.tools.messages.create(
- model=MODEL_NAME,
- system=SYSTEM_PROMPT,
- max_tokens=4096,
- messages=[{"role": "user", "content": user_message}],
- tools=tools,
- )
-
- print(f"\n{'='*50}\nModel response: {message.content}\n{'='*50}")
-
- if message.stop_reason == "tool_use":
- tool_use = next(block for block in message.content if block.type == "tool_use")
- tool_name = tool_use.name
- tool_input = tool_use.input
-
- print(f"\n{'='*50}\nUsing tool: {tool_name}\n{'='*50}")
-
- if tool_name == "execute_python":
- return code_interpret(code_interpreter, tool_input["code"])
- return []
-```
-</CodeGroup>
-
-
-## 5. Create code interpreter and run everything
-Now we are ready to run our program. At the end of `main.py` add the following code prompting the LLM to visualize a distribution of the height of men and print the median.
-
-<CodeGroup isFileName title="main.py" isRunnable={false}>
-```python {{ language: 'python' }}
-def main():
- user_message = "Visualize a distribution of height of men based on the latest data you know. Also, print the median value."
-
- # Create the CodeInterpreter object and save it as code_interpreter
- with CodeInterpreter() as code_interpreter:
- code_interpreter_results, code_interpreter_logs = chat(
- code_interpreter,
- user_message,
- )
-
- print(code_interpreter_logs)
-
- first_result= code_interpreter_results[0]
- print(first_result)
-```
-</CodeGroup>
-
-After running your code with the following command
-<CodeGroup isRunnable={false}>
-```bash {{ language: 'bash' }}
-$ python main.py
-```
-</CodeGroup>
-
-you should see results similar to this:
-
-```sh
-stdout=['The median male height is 175.5 cm\n'] stderr=[]
-<Figure size 800x400 with 1 Axes>
-```
-
-We got our median in the logs (`stdout`, and `stderr`) but we also something intering in `first_result`.
-```sh
-<Figure size 800x400 with 1 Axes>
-```
-
-## 6. Save generated chart
-
-This looks like a plot. Let's save it to a file. Add the following to the end of `main.py` and run the code again with `python main.py` in your terminal.
-<CodeGroup isFileName title="main.py" isRunnable={false}>
-```python {{ language: 'python' }}
- # If we received a chart in PNG form, we can visualize it
- if first_result.png:
- # Decode the base64 encoded PNG data
- png_data = base64.b64decode(first_result.png)
-
- # Generate a unique filename for the PNG
- filename = f"chart.png"
-
- # Save the decoded PNG data to a file
- with open(filename, "wb") as f:
- f.write(png_data)
-
- print(f"Saved chart to {filename}")
-```
-</CodeGroup>
-
-The chart was saved in the `chart.png` file and it should look similar to this:
-
-<Image
- src={imgChart}
- className="rounded w-full"
- alt="Chart visualizing distribution height of men"
- unoptimized
-/>
\ No newline at end of file
diff --git a/apps/web/src/app/(docs)/docs/open-source/page.mdx b/apps/web/src/app/(docs)/docs/open-source/page.mdx
deleted file mode 100644
index 175d04fcd..000000000
--- a/apps/web/src/app/(docs)/docs/open-source/page.mdx
+++ /dev/null
@@ -1,10 +0,0 @@
-# Open source
-
-E2B is fully open source including the infrastructure layer.
-
-- [E2B monorepo containing the SDKs, CLI, and docs](https://github.com/e2b-dev/e2b)
-- [E2B infrastructure](https://github.com/e2b-dev/infra)
-- [Example code interpreter ChatGPT plugin](https://github.com/e2b-dev/llm-code-interpreter)
-- [List of awesome SDKs for AI agents](https://github.com/e2b-dev/awesome-sdks-for-ai-agents)
-- [List of awesome AI agents](https://github.com/e2b-dev/awesome-ai-agents)
-{/* - [E2B cookbook](https://github.com/e2b-dev/e2b-cookbook) */}
diff --git a/apps/web/src/app/(docs)/docs/page.mdx b/apps/web/src/app/(docs)/docs/page.mdx
index de638db03..a284c610b 100644
--- a/apps/web/src/app/(docs)/docs/page.mdx
+++ b/apps/web/src/app/(docs)/docs/page.mdx
@@ -1,55 +1,42 @@
import { Guides } from '@/components/Guides'
-import { UseCases } from '@/components/UseCases'
import { HeroPattern } from '@/components/HeroPattern'
import { Button } from '@/components/Button'
-<HeroPattern />
-
-# Code interpreting for your AI app
-E2B's [Code Interpreter SDK](https://github.com/e2b-dev/code-interpreter) allows you to add code interpreting capabilities to your AI apps. {{ className: 'lead' }}
+import { Quickstart } from '@/components/Quickstart'
+import { Concepts } from '@/components/Concepts'
+import { UseCases } from '@/components/UseCases'
-With code interpreting, you can build apps like:
-- AI code execution
-- Data analysis with AI
-- AI tutors
-- Reasoning modules for LLM
+<HeroPattern />
-## Quickstart
+# E2B Documentation
+Here you'll find all the guides, concepts, and API reference for developing with E2B.
-### 1. Install SDK
<CodeGroup isRunnable={false}>
```bash {{ language: 'js' }}
-npm i @e2b/code-interpreter
+npm i e2b
```
```bash {{ language: 'python' }}
-pip install e2b_code_interpreter
+pip install e2b
```
</CodeGroup>
-### 2. Execute code with code interpreter inside sandbox
-<CodeGroup isRunnable={false}>
-```ts {{ language: 'js' }}
-import { CodeInterpreter } from '@e2b/code-interpreter'
+## What is E2B?
+E2B is an [open-source](https://github.com/e2b-dev) infrastructure that allows you run to AI-generated code in secure isolated sandboxes in the cloud.
+To start and control sandboxes, use our [Python SDK](https://pypi.org/project/e2b/) or [JavaScript SDK](https://www.npmjs.com/package/e2b). {{ className: 'lead' }}
-const sandbox = await CodeInterpreter.create()
-await sandbox.notebook.execCell('x = 1')
+The E2B Sandbox is a small isolated VM. You can think of it as a small computer for the AI model. You can run many sandboxes at once. Typically you run separate sandbox for each LLM, user, or AI agent session in your app.
+For example, if you were building an AI data analysis chatbot, you would start the sandbox for every user session.
-const execution = await sandbox.notebook.execCell('x+=1; x')
-console.log(execution.text) // outputs 2
+Some of the typical use cases for E2B are AI data analysis or visualization, running AI-generated code of various languages, playground for coding agents, environment for codegen evals, or running full AI-generated apps like in [Fragments](https://github.com/e2b-dev/fragments).
-await sandbox.close()
-```
+## Quickstart
+<Quickstart/>
-```py {{ language: 'python' }}
-from e2b_code_interpreter import CodeInterpreter
+## [TODO] Code interpreting
+1. Analyze data with LLM & E2B
+2. Create charts & visualizations
-with CodeInterpreter() as sandbox:
- sandbox.notebook.exec_cell("x = 1")
- execution = sandbox.notebook.exec_cell("x+=1; x")
- print(execution.text) # outputs 2
-```
-</CodeGroup>
+## Learn the core concepts
+<Concepts/>
-### 3. Hello World guide
-Dive depeer and check out the [JavaScript](/docs/hello-world/js) and [Python](/docs/hello-world/py) Hello World guides to learn how to connect the code interpreter to LLMs.
diff --git a/apps/web/src/app/(docs)/docs/pricing/SwitchToHobbyButton.tsx b/apps/web/src/app/(docs)/docs/pricing/SwitchToHobbyButton.tsx
deleted file mode 100644
index 8d1aab5f0..000000000
--- a/apps/web/src/app/(docs)/docs/pricing/SwitchToHobbyButton.tsx
+++ /dev/null
@@ -1,57 +0,0 @@
-'use client'
-
-import Link from 'next/link'
-import { useEffect, useState } from 'react'
-import { Button } from '@/components/Button'
-import { Team, useUser } from '@/utils/useUser'
-import { tiers } from '@/utils/consts'
-import Spinner from '@/components/Spinner'
-
-import { TierActiveTag } from './TierActiveTag'
-
-function SwitchToHobbyButton({ team }: { team: Team }) {
- const { user, isLoading } = useUser()
- const [url, setURL] = useState('')
-
- useEffect(function getBillingURL() {
- if (!user) return
- const u = `${process.env.NEXT_PUBLIC_STRIPE_BILLING_URL}?prefilled_email=${user.teams[0].email}`
- setURL(u)
- }, [user])
-
- if (isLoading) {
- return <Spinner />
- }
-
- if (!user) {
- return (
- <Link href="/auth/sign-up">
- <Button>Sign Up</Button>
- </Link>
- )
- }
-
- // Only show the button if the user is on the base_v1 tier.
- // Teams can have custom tiers. We only want the button to users on the free tier.
- if (team.tier !== tiers.hobby.id && team.tier !== tiers.pro.id) {
- return null
- }
-
- return (
- <div className="flex flex-col items-start justify-start gap-1 my-4">
- <div className="flex items-center justify-start gap-2">
- {team.tier === tiers.hobby.id && (
- <TierActiveTag />
- )}
-
- {team.tier !== tiers.hobby.id && (
- <a href={url} target="_blank" rel="noreferrer noopener">
- <Button>Switch to {tiers.hobby.displayName}</Button>
- </a>
- )}
- </div>
- </div>
- )
-}
-
-export default SwitchToHobbyButton
diff --git a/apps/web/src/app/(docs)/docs/pricing/SwitchToProButton.tsx b/apps/web/src/app/(docs)/docs/pricing/SwitchToProButton.tsx
deleted file mode 100644
index 34eb35201..000000000
--- a/apps/web/src/app/(docs)/docs/pricing/SwitchToProButton.tsx
+++ /dev/null
@@ -1,89 +0,0 @@
-'use client'
-
-import Link from 'next/link'
-import { Button } from '@/components/Button'
-import { Team, useUser } from '@/utils/useUser'
-import { useState } from 'react'
-import { tiers } from '@/utils/consts'
-import Spinner from '@/components/Spinner'
-
-import { TierActiveTag } from './TierActiveTag'
-
-const billingApiURL = process.env.NEXT_PUBLIC_BILLING_API_URL
-function createCheckout(tierID: string, teamID: string) {
- return fetch(`${billingApiURL}/checkouts`, {
- method: 'POST',
- headers: {
- 'Content-Type': 'application/json',
- },
- body: JSON.stringify({
- teamID,
- tierID,
- }),
- })
-}
-
-function SwitchTierButton({ team }: { team: Team }) {
- const { user, isLoading } = useUser()
- const [error, setError] = useState('')
-
- async function createCheckoutSession() {
- setError('')
-
- if (!user) {
- return setError('You must be logged in to switch to Pro.')
- }
-
- const response = await createCheckout(tiers.pro.id, user.teams[0].id)
- const responseData = await response.json()
-
- if (responseData.error) {
- setError(responseData.error)
- } else {
- window.open(responseData.url, '_blank')
- }
- }
-
- if (isLoading) {
- return <Spinner />
- }
-
-
- if (!user) {
- return (
- <Link href="/auth/sign-up">
- <Button>Sign Up</Button>
- </Link>
- )
- }
-
-
- // Only show the button if the user is on the base_v1 tier.
- // Teams can have custom tiers. We only want the button to users on the free tier.
- if (!billingApiURL || (team.tier !== tiers.hobby.id && team.tier !== tiers.pro.id)) {
- return
- }
-
- return (
- <div className="flex flex-col items-start justify-start gap-1 my-4">
- <div className="flex items-center justify-start gap-2">
- {team.tier === tiers.pro.id && (
- <TierActiveTag />
- )}
- {team.tier !== tiers.pro.id && (
- <Button
- onClick={createCheckoutSession}
- >
- Switch to Pro
- </Button>
- )}
- </div>
-
- {error && (
- <span className="text-red-500 font-medium">{error}</span>
- )}
- </div>
- )
-}
-
-export default SwitchTierButton
diff --git a/apps/web/src/app/(docs)/docs/pricing/TierActiveTag.tsx b/apps/web/src/app/(docs)/docs/pricing/TierActiveTag.tsx
deleted file mode 100644
index 5203ce8a7..000000000
--- a/apps/web/src/app/(docs)/docs/pricing/TierActiveTag.tsx
+++ /dev/null
@@ -1,9 +0,0 @@
-
-export function TierActiveTag() {
- return (
- <span className="text-sm font-bold text-green-500">
- ACTIVE
- </span>
- )
-}
-
diff --git a/apps/web/src/app/(docs)/docs/pricing/page.mdx b/apps/web/src/app/(docs)/docs/pricing/page.mdx
deleted file mode 100644
index cd25c9756..000000000
--- a/apps/web/src/app/(docs)/docs/pricing/page.mdx
+++ /dev/null
@@ -1,66 +0,0 @@
-import ManageBilling from '@/components/ManageBilling'
-import SandboxSpec from '@/components/SandboxSpec'
-
-# Pricing
-
-[Manage Billing](/dashboard?tab=billing)
-
-We charge you based on your real sandbox usage. All new users get one-time free $100 worth of usage in credits. {{ className: 'lead' }}
-
----
-
-# Plans pricing
-Additionally to the usage costs, you can also select a tier that includes dedicated support, prioritized features, and higher sandbox limits.
-
-## Hobby tier
-**$0/month + usage costs**
-
-- One-time $100 of usage in credits
-- Community support
-- Up to 1 hour sandbox session length
-- Up to 20 concurrently running sandboxes
-
-## Pro tier
-**$150/month + usage costs**
-
-- One-time $100 of usage in credits
-- Dedicated Slack channel with live Pro support from our team
-- Prioritized features
-- Customize your [sandbox compute](/docs/sandbox/compute)
-- Up to 24 hours sandbox session length
-- Up to 100 concurrently running sandboxes
-
-
-If you need any additional features or resources, please [reach out to us](/docs/getting-help) with your use case.
-
----
-
-# Compute pricing
-We charge per second of a running sandbox.
-- vCPU: $0.000014 per second (~$0.05 per hour)
-- GiB RAM: $0.0000045 per second (~$0.018 per hour)
-- GiB storage: Free
-
-<Note>
-1 GiB is equal to 1,024 MiB
-</Note>
-
-## Sandbox compute
-Pro customers can customize the sandbox with **any combination** of the CPU and RAM based on the following tables.
-
-<Note>
-<b>By default your sandbox has 2 vCPU and 512 MiB RAM.</b>
-
-To customize your sandbox compute, you need to build your custom sandbox template using the [E2B CLI](/docs/cli/installation).
-Run [`e2b template build`](/docs/cli/commands#template-build) and specify the `--cpu-count` and `--memory-mb` options.
-
-For example this custom build gives your sandbox 8 vCPU and 4GiB of RAM
-```sh
-e2b template build --cpu-count 8 --memory-mb 4096
-```
-</Note>
-
-<SandboxSpec/>
-
-<br/>
-[Let us know](/docs/getting-help) if you need more powerful compute.
diff --git a/apps/web/src/app/(docs)/docs/quickstart/page.mdx b/apps/web/src/app/(docs)/docs/quickstart/page.mdx
new file mode 100644
index 000000000..b9b34ff7c
--- /dev/null
+++ b/apps/web/src/app/(docs)/docs/quickstart/page.mdx
@@ -0,0 +1,64 @@
+# Running your first Sandbox
+
+This guide will show you how to start your first E2B Sandbox.
+
+## 1. Create E2B account
+
+Every new E2B account get $100 in credits. You can sign up [here](e2b.dev/auth/sign-up).
+
+
+## 2. Set your environment variables
+1. Navigate to the [E2B Dashboard](/dashboard?tab=keys).
+2. Copy your API key.
+3. Paste your E2B API key into your `.env` file.
+<CodeGroup title=".env">
+```bash
+E2B_API_KEY=e2b_***
+```
+</CodeGroup>
+
+
+## 3. Install SDK
+Install the E2B SDK to your project by running the following command in your terminal.
+<CodeGroup isTerminalCommand>
+```bash {{ language: 'js' }}
+npm i e2b dotenv
+```
+```bash {{ language: 'python' }}
+pip install e2b python-dotenv
+```
+</CodeGroup>
+
+## 4. Write code for starting Sandbox
+<CodeGroup>
+```ts {{ language: 'js', description: 'index.ts' }}
+import 'dotenv/config'
+import { Sandbox } from 'e2b'
+
+const sbx = await Sandbox.create() // By default the sandbox is alive for 5 minutes
+const execution = await sbx.runCode('print("hello world")') // Execute Python inside the sandbox
+console.log(execution.logs)
+```
+
+```python {{ language: 'python', description: 'main.py' }}
+from dotenv import load_dotenv
+load_dotenv()
+
+from e2b import Sandbox
+sbx = Sandbox() # By default the sandbox is alive for 5 minutes
+execution = sbx.run_code("print('hello world')") # Execute Python inside the sandbox
+print(execution.logs)
+```
+</CodeGroup>
+
+## 5. Start your first E2B Sandbox
+<CodeGroup isTerminalCommand>
+```bash {{ language: 'js' }}
+npx tsx ./index.ts
+```
+```bash {{ language: 'python' }}
+python main.py
+```
+</CodeGroup>
+
+
diff --git a/apps/web/src/app/(docs)/docs/sandbox/api/cwd/page.mdx b/apps/web/src/app/(docs)/docs/sandbox/api/cwd/page.mdx
deleted file mode 100644
index 2ee3543dd..000000000
--- a/apps/web/src/app/(docs)/docs/sandbox/api/cwd/page.mdx
+++ /dev/null
@@ -1,21 +0,0 @@
-# Current Working Directory
-
-You can set a working directory either for the whole sandbox, a filesystem operation, or a new process.
-
-## Sandbox
-
-If the current working directory for the sandbox is not set, it will default to the home directory - `/home/user`.
-
-<CodeGroupAutoload path="cwd/sandbox" />
-
-## Filesystem
-
-All filesystem operations with relative paths are relative to the current working directory.
-
-<CodeGroupAutoload path="cwd/filesystem"/>
-
-## Process
-
-If you set a working directory for the sandbox, all processes will inherit it. You can override it for each process.
-
-<CodeGroupAutoload path="cwd/process"/>
diff --git a/apps/web/src/app/(docs)/docs/sandbox/api/debugging/page.mdx b/apps/web/src/app/(docs)/docs/sandbox/api/debugging/page.mdx
deleted file mode 100644
index f5a7daa80..000000000
--- a/apps/web/src/app/(docs)/docs/sandbox/api/debugging/page.mdx
+++ /dev/null
@@ -1,14 +0,0 @@
-export const sections = [
- { title: 'Logging', id: 'logging' },
-]
-
-# Logging
-
-<LanguageSpecificText>
- ```js {{ language: 'js', text: "E2B package logs only warnings & errors to the console by default. Below is an example of how to fully customize the logging levels.\n\nFeel free to override the logger with your own implementation with debug, info, warn, and error methods." }}
- ```
- ```python {{ language: 'python', text: "E2B package uses the standard Python logging module You can configure the logging level, handlers and format as you would with any other Python application. \n\nBelow is an example of how to configure the logging module to log to the console." }}
- ```
-</LanguageSpecificText>
-
-<CodeGroupAutoload path="logging/e2b_logging" isRunnable={false} />
diff --git a/apps/web/src/app/(docs)/docs/sandbox/api/download/page.mdx b/apps/web/src/app/(docs)/docs/sandbox/api/download/page.mdx
deleted file mode 100644
index 27fddc6e9..000000000
--- a/apps/web/src/app/(docs)/docs/sandbox/api/download/page.mdx
+++ /dev/null
@@ -1,9 +0,0 @@
-# Download files from the sandbox
-Any file inside the sandbox can be downloaded using the `downloadFile`/`download_file` method.
-
-## Use case for downloading files
-For example, the download file method is useful for downloading any files produced by LLM. You can let LLM generate and execute code inside the sandbox.
-This LLM-generated code might produce some files like charts, CSV files, or PDF files that you want to download to your machine.
-
-<CodeGroupAutoload path="basics/download_file" isRunnable={false}/>
-
diff --git a/apps/web/src/app/(docs)/docs/sandbox/api/envs/page.mdx b/apps/web/src/app/(docs)/docs/sandbox/api/envs/page.mdx
deleted file mode 100644
index 5db20d3ec..000000000
--- a/apps/web/src/app/(docs)/docs/sandbox/api/envs/page.mdx
+++ /dev/null
@@ -1,21 +0,0 @@
-# Setting environment variables
-
-## Global environment variables
-You can set the sandbox's global environment variables when initializing a new sandbox.
-<CodeGroupAutoload
- path="basics/set_env_vars"
- isRunnable={false}
-/>
-
-
-## Environment variables per process
-Alternatively, you can set environment variables when starting a new process. These environment variables are accessible only for this process.
-
-<Note>
-Environment variables set when starting a new process have precedence over the environment variables set when initializing the sandbox.
-</Note>
-
-<CodeGroupAutoload
- path="basics/process_env_vars"
- isRunnable={true}
-/>
\ No newline at end of file
diff --git a/apps/web/src/app/(docs)/docs/sandbox/api/filesystem/page.mdx b/apps/web/src/app/(docs)/docs/sandbox/api/filesystem/page.mdx
deleted file mode 100644
index 60babcfe6..000000000
--- a/apps/web/src/app/(docs)/docs/sandbox/api/filesystem/page.mdx
+++ /dev/null
@@ -1,56 +0,0 @@
-## List directory
-
-<CodeGroupAutoload
- path="basics/fs_ls"
- isRunnable={true}
-/>
-
-## Create directory
-
-Create directory and all parent directories.
-
-<CodeGroupAutoload
- path="basics/fs_mkdir"
- isRunnable={false}
-/>
-
-## Write to file
-
-When writing to a file that doesn't exist, the file will get created.
-
-When writing to a file that already exists, the file will get overwritten.
-
-When writing to a file that's in a directory that doesn't exist, you'll get an error.
-
-<CodeGroupAutoload
- path="basics/fs_write"
- isRunnable={true}
-/>
-
-## Read from file
-
-<CodeGroupAutoload
- path="basics/fs_read"
- isRunnable={true}
-/>
-
-## Write bytes
-
-<CodeGroupAutoload
- path="basics/fs_write_bytes"
- isRunnable={true}
-/>
-
-## Read bytes
-
-<CodeGroupAutoload
- path="basics/fs_read_bytes"
- isRunnable={true}
-/>
-
-## Watch directory for changes
-
-<CodeGroupAutoload
- path="basics/fs_watch"
- isRunnable={true}
-/>
diff --git a/apps/web/src/app/(docs)/docs/sandbox/api/metadata/page.mdx b/apps/web/src/app/(docs)/docs/sandbox/api/metadata/page.mdx
deleted file mode 100644
index f23a3c2cb..000000000
--- a/apps/web/src/app/(docs)/docs/sandbox/api/metadata/page.mdx
+++ /dev/null
@@ -1,8 +0,0 @@
-## Sandbox metadata
-
-You can assign metadata to your sandbox. This metadata will be available if you call `Sandbox.list()`. This can be useful in situation where each of your users have dedicated sandbox and the time between the steps of the integration is long. You can use the metadata to store the user id and reconnect to it later.
-
-<CodeGroupAutoload
- path="basics/metadata"
- isRunnable={true}
-/>
diff --git a/apps/web/src/app/(docs)/docs/sandbox/api/process/page.mdx b/apps/web/src/app/(docs)/docs/sandbox/api/process/page.mdx
deleted file mode 100644
index 0519cf5ef..000000000
--- a/apps/web/src/app/(docs)/docs/sandbox/api/process/page.mdx
+++ /dev/null
@@ -1,58 +0,0 @@
-# Starting process inside a sandbox
-
-Here are the basic operations you can do with the process inside the sandbox:
-
-- [Start process](/docs/sandbox/api/process#start-process)
-- [Stop process](/docs/sandbox/api/process#stop-process)
-- [Stdout](/docs/sandbox/api/process#stream-stdout)
-- [Stdin](/docs/sandbox/api/process#send-stdin)
-- [Stderr](/docs/sandbox/api/process#stream-stderr)
-- [On exit](/docs/sandbox/api/process#on-process-exit)
-
-## Start process
-
-<CodeGroupAutoload
- path="basics/process_start"
- isRunnable={true}
-/>
-
-## Stop process
-
-<CodeGroupAutoload
- path="basics/process_stop"
- isRunnable={false}
-/>
-
-## Stream stdout
-
-Set either stdout handler for the whole sandbox level or per process.
-
-<CodeGroupAutoload
- path="basics/process_stream_stdout"
- isRunnable={false}
-/>
-
-## Stream stderr
-
-Set either stderr handler for the whole sandbox level or per process.
-
-<CodeGroupAutoload
- path="basics/process_stream_stderr"
- isRunnable={false}
-/>
-
-## On process exit
-
-Set either on exit handler for the whole sandbox level or per process.
-
-<CodeGroupAutoload
- path="basics/process_exit"
- isRunnable={false}
-/>
-
-## Send stdin
-
-<CodeGroupAutoload
- path="basics/process_write_stdin"
- isRunnable={true}
-/>
\ No newline at end of file
diff --git a/apps/web/src/app/(docs)/docs/sandbox/api/reconnect/page.mdx b/apps/web/src/app/(docs)/docs/sandbox/api/reconnect/page.mdx
deleted file mode 100644
index f97f8b001..000000000
--- a/apps/web/src/app/(docs)/docs/sandbox/api/reconnect/page.mdx
+++ /dev/null
@@ -1,42 +0,0 @@
-# Connect to running sandbox
-
-Disconnect and reconnect later to the same sandbox while keeping it alive {{ className: 'lead' }}
-
-## Description
-
-The sandboxes are by default kept alive only when connected to them. When you disconnect from a sandbox, it will be destroyed.
-
-If you want to keep the sandbox alive even after disconnecting from it, you can explicitly say for how long you want to keep it alive. You can then disconnect from the sandbox and reconnect to it later. This can be useful for example in a **serverless environment** or **chatbot application**.
-
-The duration limit to keep the sandbox alive is 1 hour. If you need more, feel free to [reach out to us](/docs/getting-help) with your use.
-
-## Keep sandbox alive
-
-The example below shows how to disconnect from a running sandbox and reconnect to it again while keeping the sandbox alive.
-
-<CodeGroupAutoload
- path="reconnect/reconnect_1"
- isRunnable={false}
-/>
-
-Call the `keep_alive`/`keepAlive` method on the sandbox instance to keep it alive. You can specify the preferred duration, as a multiple of a default time unit, which is
-- 1ms in JS
-- 1s in Python.
-
-You then disconnect from the sandbox.
-
-<CodeGroupAutoload
- path="reconnect/reconnect_2"
- isRunnable={false}
-/>
-
-You can then reconnect to the sandbox from anywhere.
-
-<CodeGroupAutoload
- path="reconnect/reconnect_3"
-
- isRunnable={false}
-/>
-
-## Use sandbox metadata
-Sandbox metadata can be very useful to store information about the sandbox. You can use it to store the user ID or any other information you need to keep track of and then use this info for reconnecting to the sandbox. You can read more about sandbox metadata [here](/docs/sandbox/api/metadata).
\ No newline at end of file
diff --git a/apps/web/src/app/(docs)/docs/sandbox/api/timeouts/page.mdx b/apps/web/src/app/(docs)/docs/sandbox/api/timeouts/page.mdx
deleted file mode 100644
index 82809fb9e..000000000
--- a/apps/web/src/app/(docs)/docs/sandbox/api/timeouts/page.mdx
+++ /dev/null
@@ -1,12 +0,0 @@
-# Timeouts
-
-The SDK has a number of timeouts that can be configured to control how long the SDK will wait for a response from the E2B servers. **The default is 60 seconds.**
-
-## Timeout creating sandbox
-<CodeGroupAutoload path="timeout/timeout_sandbox" />
-
-## Timeout process
-<CodeGroupAutoload path="timeout/timeout_process" />
-
-## Timeout filesystem operations
-<CodeGroupAutoload path="timeout/timeout_filesystem" />
\ No newline at end of file
diff --git a/apps/web/src/app/(docs)/docs/sandbox/api/upload/page.mdx b/apps/web/src/app/(docs)/docs/sandbox/api/upload/page.mdx
deleted file mode 100644
index 27362f525..000000000
--- a/apps/web/src/app/(docs)/docs/sandbox/api/upload/page.mdx
+++ /dev/null
@@ -1,12 +0,0 @@
-# Upload files to sandbox
-You can upload any file to the sandbox. This is useful if you want to let the LLM work with your files or files of your users. The file will be uploaded to the user's home directory with the same name. If a file with the same name already exists, it will be overwritten.
-
-## Use case for uploading files
-A popular workflow is for example to upload a CSV data file and then let the LLM generate and execute Python code that operates with the uploaded CSV file inside the sandbox. This way, you can essentially create your own AI data analyst or code interpreter.
-
-<Note>
-We support uploading files up to 100MB at the moment. If you need to upload larger files, please [reach out to us](/docs/getting-help).
-</Note>
-
-<CodeGroupAutoload path="basics/upload_file" isRunnable={false}/>
-
diff --git a/apps/web/src/app/(docs)/docs/sandbox/api/url/page.mdx b/apps/web/src/app/(docs)/docs/sandbox/api/url/page.mdx
deleted file mode 100644
index 21e2f2f4f..000000000
--- a/apps/web/src/app/(docs)/docs/sandbox/api/url/page.mdx
+++ /dev/null
@@ -1,10 +0,0 @@
-# Sandbox URL
-Each sandbox has its own URL that you can use to connect to any service running inside the sandbox.
-
-For example, you can start a server inside the sandbox and connect to it from your browser.
-
-<CodeGroupAutoload path="basics/get_url" isRunnable={true} />
-
-
-If you want to get an URL for a specific port inside the sandbox, pass the port number to the `getHostname()`/`get_hostname()` method.
-<CodeGroupAutoload path="basics/get_url_port" isRunnable={true} />
diff --git a/apps/web/src/app/(docs)/docs/sandbox/compute/page.mdx b/apps/web/src/app/(docs)/docs/sandbox/compute/page.mdx
deleted file mode 100644
index 9c05f7315..000000000
--- a/apps/web/src/app/(docs)/docs/sandbox/compute/page.mdx
+++ /dev/null
@@ -1,24 +0,0 @@
-import SandboxSpec from '@/components/SandboxSpec'
-
-# Sandbox compute
-Pro customers can customize the sandbox with **any combination** of the CPU and RAM based on the following tables.
-
-Read a dedicated page to [learn more about pricing](/docs/pricing).
-
-<Note>
-<b>By default your sandbox has 2 vCPU and 512 MiB RAM.</b>
-
-To customize your sandbox compute, you need to build your custom sandbox template using the [E2B CLI](/docs/cli/installation).
-Run [`e2b template build`](/docs/cli/commands#template-build) and specify the `--cpu-count` and `--memory-mb` options.
-
-For example, this custom build command gives your sandbox 8 vCPU and 4GiB of RAM
-```sh
-e2b template build --cpu-count 8 --memory-mb 4096
-```
-</Note>
-
-<SandboxSpec/>
-
-<br/>
-
-[Let us know](/docs/getting-help) if you need more powerful compute.
\ No newline at end of file
diff --git a/apps/web/src/app/(docs)/docs/sandbox/custom/page.mdx b/apps/web/src/app/(docs)/docs/sandbox/custom/page.mdx
deleted file mode 100644
index e21b47066..000000000
--- a/apps/web/src/app/(docs)/docs/sandbox/custom/page.mdx
+++ /dev/null
@@ -1,49 +0,0 @@
-# Customizing Sandbox
-Custom sandboxes allows you to spawn a sandbox with a pre-defined environment by you and then control it with our SDK.
-
-You can build a custom sandbox by creating the [Sandbox Template](/docs/sandbox/templates/overview). Sandbox template is a Dockerfile that describes the environment of your sandbox.
-
-Once you build your custom sandbox template, you can spawn multiple isolated sandboxes from it.
-
-## How it works
-1. [Provide the sandbox template file](/docs/sandbox/templates/template-file)
-1. [Build a sandbox template from it using our CLI](/docs/guide/custom-sandbox#4-build-custom-sandbox)
-1. Get a template ID from the CLI:
- ```sh
- # ... truncated CLI output
- ✅ Building sandbox template 3y5bvra6kgq0kaumgztu finished.
- ```
-1. Pass the template ID to our SDK like this:
- <CodeGroup title="Using custom sandbox with SDK" isRunnable={false}>
- ```js {{ language: 'js' }}
- import { Sandbox } from 'e2b'
-
- // Create new sandbox
- const sandbox = await Sandbox.create({
- template: '<sandbox-template-id>', // You get sandbox template ID from the CLI after you run `$ e2b build`
- })
-
- // Close sandbox once done
- await sandbox.close()
- ```
-
- ```python {{ language: 'python' }}
- from e2b import Sandbox
-
- # Create new sandbox
- sandbox = Sandbox(
- template="<sandbox-template>", # You get sandbox template from the CLI after you run `$ e2b build`
- )
-
- # Close sandbox once done
- sandbox.close()
- ```
- </CodeGroup>
-1. Run the code and we spawn a sandbox based on the template you built in step 2
-
-Now you can do step 4/5 multiple times using the same ID, always creating a separate sandbox instance.
-
-
-<Note>
-Read more on [Sandbox Templates](/docs/sandbox/templates/overview) if you want to create your own custom sandbox.
-</Note>
\ No newline at end of file
diff --git a/apps/web/src/app/(docs)/docs/sandbox/overview/features.tsx b/apps/web/src/app/(docs)/docs/sandbox/overview/features.tsx
deleted file mode 100644
index 4daec5d8e..000000000
--- a/apps/web/src/app/(docs)/docs/sandbox/overview/features.tsx
+++ /dev/null
@@ -1,30 +0,0 @@
-/* eslint-disable react/jsx-key */
-import Link from 'next/link'
-
-export const features = [
- <span>
- <Link href="https://github.com/e2b-dev/e2b" target="_blank" rel="noreferrer noopener">Open-source</Link> sandbox for LLM
- </span>,
- 'A full VM environment',
- 'No need for orchestration or infrastructure management',
- 'Ability to give each user of your AI app their own isolated environment',
- <span>
- <Link href="/docs/getting-started/installation">
- Python & Node.js SDK
- </Link>
- {' '}for controling the sandbox&apos;s{' '}
- <Link href="/docs/sandbox/api/filesystem">
- filesystem
- </Link>
- ,{' '}
- <Link href="/docs/sandbox/api/process">
- processes
- </Link>
- , and more.
- </span>,
- 'Support for up to 24h long-running sandbox sessions',
- <span>
- Ability to <Link href="/docs/sandbox/api/upload">upload files</Link> to the sandbox and <Link href="/docs/sandbox/api/download">download files </Link>from the sandbox,
- </span>,
- // "Premade sandbox for the Code Interpreter / Advanced Data Analysis and AI-powered browsers",
-]
diff --git a/apps/web/src/app/(docs)/docs/sandbox/overview/page.mdx b/apps/web/src/app/(docs)/docs/sandbox/overview/page.mdx
deleted file mode 100644
index 250facfb9..000000000
--- a/apps/web/src/app/(docs)/docs/sandbox/overview/page.mdx
+++ /dev/null
@@ -1,70 +0,0 @@
-import Image from 'next/image'
-import imgModel from '@/images/ai-app-e2b-sandbox-model.png'
-import { Check } from 'lucide-react'
-
-import { features } from './features'
-
-# Overview
-**The E2B's sandboxes are isolated cloud environments made specifcially for AI code interpreting or code execution.**
-
-The E2B sandboxes are an ideal fit as a playground for AI assistants like coding copilots, code interpreters, AI data analysts, AI browser assistants, and other AI-powered apps.
-
-## Features
-<div className="flex flex-col items-start space-y-2">
- {features.map((feature, i) => (
- <span key={i} className="flex items-center space-x-2">
- <Check
- className="w-4 h-4 text-brand-400"
- />
- <span className="text-brand-100">{feature}</span>
- </span>
- ))}
-</div>
-
-With more features coming in the future:
-- Out-of-the box working monitoring of what's happening inside the sandbox
-- LLM Access control to data, tools, and any internet requests
-- Statefull sandboxes
-- Resumable workflows (pause sandbox and load it later)
-- Unlimited long-running sandboxed
-
-## Comparison to other services
-With LLMs, it's not safe to let the LLM run code and use tools in the same environment where your application is running.
-
-You need to isolate the LLM from the rest of your app and make sure that the LLM can't access your data, tools, and the internet without you knowing about it or giving it explicit access. You need to make sure that the LLM can run untrusted code safely and install libraries on fly.
-The AI apps also often need to run for a long time, and need to be resumable - for example, when waiting for user's consent to make an internet purchase, you need to be able to pause the AI app and resume it later without losing the whole state.
-
-Additionally, the AI apps present need for a new model:
-- How can every user of your AI app have the environment described above for themselves?
-- How can developers easily manage and orchestrate these environments?
-- How can developers easily debug these environments?
-- How to let LLMs use the same tools as humans do on their computers (for example browser, code linters, autocomplete, etc)?
-- How can developers easily monitor what's happening inside these environments?
-- How to scale these environments to billions of instances?
-
-<Image
- src={imgModel}
- className="rounded w-full"
- alt="Separate E2B Sandbox for each instance of your AI app"
- unoptimized
-/>
-
-E2B Sandboxes are made exactly to solve these challenges. The sandbox is like an isolated runtime or playground for the LLM. **We give you our SDK to spawn and control these sandboxes.**
-
-
-## How sandboxes work under the hood
-When you create a new sandbox session, we start a small VM in our cloud. This VM is running a Ubuntu OS and it takes about 400-600ms to start it.
-
-Inside this sandbox, your AI app can [run code and start any programs](/docs/sandbox/api/process), access the internet to download or upload data, use the [filesystem](/docs/sandbox/api/filesystem), start long running processes such as web servers, and more.
-You can also [upload](/docs/sandbox/api/upload) to sandbox and [download](/docs/sandbox/api/upload) from sandbox any file you want.
-
-To start and control the sandbox, use the [E2B SDK](/docs/getting-started/installation) for Python or JavaScript.
-
-<CodeGroupAutoload
- title="Starting Sandbox"
- path="basics/init"
-/>
-
-<Note>
-Make sure you have the `E2B_API_KEY` environment variable set with your [API key](/docs/getting-started/api-key).
-</Note>
diff --git a/apps/web/src/app/(docs)/docs/sandbox/templates/overview/page.mdx b/apps/web/src/app/(docs)/docs/sandbox/templates/overview/page.mdx
deleted file mode 100644
index 2b062e002..000000000
--- a/apps/web/src/app/(docs)/docs/sandbox/templates/overview/page.mdx
+++ /dev/null
@@ -1,69 +0,0 @@
-import Image from 'next/image'
-import imgCustomSandbox from '@/images/custom-sandbox.png'
-
-# Custom Sandbox
-
-Custom sandboxes allow you to spawn a sandbox with an environment predefined by you and then control it with our SDK.
-
-<Note>
-The E2B Sandbox is a secure way to run your AI app. It is a long-running cloud environment where you can let any LLM (GPTs, Claude, local LLMs, etc) use tools exactly like you would do locally.
-
-Read more about E2B Sandboxes [here](/docs/sandbox/overview).
-</Note>
-
-
-## How Custom Sandboxes Work
-
-<Note>
-Follow our [guide](/docs/guide/custom-sandbox) on how to create a custom sandbox.
-</Note>
-
-1. You build a custom sandbox by creating the [Sandbox Template](/docs/sandbox/templates/template-file) which is a Dockerfile describing the environment of your sandbox.
-1. Build a sandbox template from it using our CLI
-1. Get a template ID from the CLI:
- ```sh
- # ... truncated CLI output
- ✅ Building sandbox template 3y5bvra6kgq0kaumgztu finished.
- ```
-1. Pass the template ID to our SDK like this:
- <CodeGroup title="Using custom sandbox with SDK" isRunnable={false}>
- ```js {{ language: 'js' }}
- import { Sandbox } from 'e2b'
-
- // Create new sandbox
- const sandbox = await Sandbox.create({
- // You get sandbox template from the CLI after you run `$ e2b build`
- template: '<sandbox-template>', // $HighlightLine
- })
-
- // Close sandbox once done
- await sandbox.close()
- ```
-
- ```python {{ language: 'python' }}
- from e2b import Sandbox
-
- # Create new sandbox
- sandbox = Sandbox(
- # You get sandbox template from the CLI after you run `$ e2b build`
- template="<sandbox-template>", # $HighlightLine
- )
-
- # Close sandbox once done
- sandbox.close()
- ```
- </CodeGroup>
-1. Run the code and we spawn a sandbox based on the template you built in step 2
-
-Once you build your custom sandbox template, you can spawn multiple isolated sandboxes from it. You can repeat the steps 4, 5 multiple times using the same ID, always creating a separate sandbox instance.
-
-<Image
- src={imgCustomSandbox}
- className="rounded w-full"
- alt="Graphics explaining how custom sandbox works"
- unoptimized
-/>
-
-<Note>
-Follow [our guide](/docs/guide/custom-sandbox) on how to create a custom sandbox.
-</Note>
\ No newline at end of file
diff --git a/apps/web/src/app/(docs)/docs/sandbox/templates/start-cmd/page.mdx b/apps/web/src/app/(docs)/docs/sandbox/templates/start-cmd/page.mdx
deleted file mode 100644
index 73f4b68ba..000000000
--- a/apps/web/src/app/(docs)/docs/sandbox/templates/start-cmd/page.mdx
+++ /dev/null
@@ -1,91 +0,0 @@
-# Start Command
-The start command allows you to specify a command that will be **already running** when you spawn your custom sandbox.
-This way, you can for example have running servers or seeded databases inside the sandbox that are already fully ready when you spawn the sandbox using the SDK and with zero waiting time for your users during the runtime.
-
-The idea behind the start command feature is to lower the wait times for your users and have everything ready for your users when you spawn your sandbox.
-
-
-## How to add start command
-
-When you are building a sandbox template you can specify the start command by using the [`-c`](/docs/cli/commands#build) option:
-
-```bash
-e2b build -c "<your-start-command>"
-```
-
-When you spawn the custom sandbox you built, the start command will be already running if there was no error when we tried to execute it.
-
-
-## How it works
-Every time you are building a [custom sandbox](/docs/guide/custom-sandbox), we create a container based on the [`e2b.Dockerfile`](/docs/sandbox/templates/template-file) file you create in the process.
-We extract the container's filesystem and start a sandbox with this extracted filesystem.
-We call this sandbox a _template sandbox_.
-
-Then, these steps happen:
-
- 1. We take the running template sandbox.
- 2. (Only if you specified the start command, otherwise this step is skipped) **Execute the start command and wait 15 seconds**.
- 3. Snapshot the sandbox and make it ready for you to spawn it with the SDK.
-
-
-<Note title="Sandbox Snapshot">
-Snapshots are saved running sandboxes. We serialize and save the whole sandbox's filesystem together with all the running processes in a way that can be loaded later.
-
-This allows us to load the sandbox in a few hundred milliseconds any time later with all the processes already running and the filesystem exactly as it was.
-</Note>
-
-
-## Limits
-- The network isn't accessible when running the start command.
-- We wait 15 seconds after we execute the start command before we snapshot the sandbox.
-
-
-## Logs
-You can retrieve the start command's logs using the SDK during runtime:
-
-<CodeGroup title="Check start command logs" isRunnable={false}>
-```js {{ language: 'js' }}
-import { Sandbox } from 'e2b'
-
-// Spawn your custom sandbox
-const sandbox = await Sandbox.create({
- id: 'my-agent-sandbox',
- // If you specify onStderr and onStdout handlers when spawning the sandbox
- // you will see logs from the start command.
- onStderr: output => console.log("stderr", output.line), // $HighlightLine
- onStdout: output => console.log("stdout", output.line), // $HighlightLine
-})
-
-// Close sandbox once done
-await sandbox.close()
-```
-
-```python {{ language: 'python' }}
-from e2b import Sandbox
-
-# Spawn your custom sandbox
-sandbox = Sandbox(
- id="my-agent-sandbox",
- # If you specify on_stderr and on_stdout handlers when spawning the sandbox
- # you will see logs from the start command.
- on_stderr=lambda output: print("stderr", output.line), # $HighlightLine
- on_stdout=lambda output: print("stdout", output.line), # $HighlightLine
-)
-
-# Close sandbox once done
-sandbox.close()
-```
-</CodeGroup>
-
-
-## Sandbox template config
-The start command is specified inside the `e2b.toml` in the same directory where you ran `e2b build -c "<your-start-command>"`.
-<CodeGroup isFileName title="e2b.toml" isRunnable={false}>
-```toml
-# This is a config for E2B sandbox template
-template_id = "1wdqsf9le9gk21ztb4mo"
-dockerfile = "e2b.Dockerfile"
-template_name = "my-agent-sandbox"
-start_cmd = "<your-start-command>" # $HighlightLine
-```
-</CodeGroup>
diff --git a/apps/web/src/app/(docs)/docs/sandbox/templates/template-file/page.mdx b/apps/web/src/app/(docs)/docs/sandbox/templates/template-file/page.mdx
deleted file mode 100644
index be02d47a0..000000000
--- a/apps/web/src/app/(docs)/docs/sandbox/templates/template-file/page.mdx
+++ /dev/null
@@ -1,50 +0,0 @@
-import Image from 'next/image'
-import imgCustomSandbox from '@/images/custom-sandbox.png'
-
-# Template File
-
-The template file is a Dockerfile named `e2b.Dockerfile`. The template file is used to define an environment for your custom sandbox. {{ className: 'lead' }}
-
-<Note>
-Follow our [guide](/docs/guide/custom-sandbox) on how to create a custom sandbox.
-</Note>
-
-<Image
- src={imgCustomSandbox}
- className="rounded w-full"
- alt="Graphics explaining how custom sandbox works"
- unoptimized
-/>
-
-## `e2b.Dockerfile`
-The Dockerfile must be Debian based (e.g. Ubuntu). Only the following [Dockerfile commands](https://docs.docker.com/engine/reference/builder/) are supported:
- - `FROM`
- - `ADD`
- - `COPY`
- - `RUN`
- - `WORKDIR`
- - `ARG`
-
-## Example
-
-The following example template file defines a Ubuntu-based sandbox with installed GitHub CLI.
-
-
-<CodeGroup isFileName title="e2b.Dockerfile" isRunnable={false}>
-```sh
-# You can use most of the Debian-based base images
-FROM ubuntu:22.04
-
-# Install dependencies and customize sandbox
-RUN apt update \
- && apt install sudo
-
-# Install GitHub CLI
-RUN type -p curl >/dev/null || (sudo apt update && sudo apt install curl -y)
-RUN curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg \
- && sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg \
- && echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null \
- && sudo apt update \
- && sudo apt install gh -y
-```
-</CodeGroup>
diff --git a/apps/web/src/app/(docs)/docs/supported/page.mdx b/apps/web/src/app/(docs)/docs/supported/page.mdx
deleted file mode 100644
index b2576bde8..000000000
--- a/apps/web/src/app/(docs)/docs/supported/page.mdx
+++ /dev/null
@@ -1,9 +0,0 @@
-# Supported LLMs and AI frameworks
-E2B is LLM agnostic - it supports any LLM models and any AI frameworks.
-
-Usually, all you need from the model is just support for tool use. You then use the E2B code interpreter as a tool.
-If the LLM doesn't support tool use, you can ask the LLM to respond with Markdown or XML and parse the LLM's output on your own. Then just pass the parsed code from code blocks to the code interpreter.
-
-<Note>
-Check out our [cookbook](https://github.com/e2b-dev/e2b-cookbook) for examples.
-</Note>
\ No newline at end of file
diff --git a/apps/web/src/components/Code.tsx b/apps/web/src/components/Code.tsx
index 08bfd3ffd..18568b664 100644
--- a/apps/web/src/components/Code.tsx
+++ b/apps/web/src/components/Code.tsx
@@ -6,7 +6,6 @@ import { Tab } from '@headlessui/react'
import clsx from 'clsx'
import { create } from 'zustand'
import {
- File,
Terminal,
} from 'lucide-react'
@@ -31,6 +30,25 @@ export function getPanelTitle({
return 'Code'
}
+function extractPanelProps(props: any) {
+ let { language } = props
+ if (language && language in languageNames) {
+ language = languageNames[language]
+ }
+ return { description: props.description || '', language }
+}
+
+function renderLanguageLogo(props: any) {
+ const { language } = extractPanelProps(props)
+ if (language === 'JavaScript & TypeScript') {
+ return <Image src={logoNode} alt="" className="h-7 w-7" unoptimized />
+ } else if (language === 'Python') {
+ return <Image src={logoPython} alt="" className="h-7 w-7" unoptimized />
+ }
+ return null
+}
+
+
function CodePanel({
children,
code,
@@ -66,17 +84,16 @@ function CodePanel({
)
}
+
export function CodeGroupHeader({
title,
children,
selectedIndex,
- isFileName,
isTerminalCommand,
}: {
title: string;
children: React.ReactNode;
selectedIndex: number;
- isFileName?: boolean;
isTerminalCommand?: boolean;
}) {
const hasTabs = Children.count(children) > 1
@@ -84,50 +101,10 @@ export function CodeGroupHeader({
return (
<div
- className="flex min-h-[calc(theme(spacing.12)+1px)] flex-wrap items-center justify-between gap-x-4 border-b border-zinc-700 bg-zinc-800 px-4 dark:border-zinc-800 dark:bg-transparent">
- <div className="flex flex-col items-start">
- {title && (
- <div>
- {isFileName ? (
- <div className="flex items-center justify-start space-x-2">
- <File
- className="text-brand-300"
- size={18}
- strokeWidth={1}
- />
- <h3 className="text-sm text-gray-500 font-mono">{title}</h3>
- </div>
- ) : isTerminalCommand ? (
- <div className="flex items-center justify-start space-x-2">
- <Terminal
- className="text-brand-300"
- size={18}
- strokeWidth={1}
- />
- {title && (
- <h3 className="text-sm text-gray-500">{title}</h3>
- )}
- </div>
- ) : (
- <h3 className="pt-3 text-sm text-gray-500 text-brand-400">{title}</h3>
- )}
- </div>
- )}
-
- {isTerminalCommand && !title && (
- <div className="flex items-center justify-start space-x-2">
- <Terminal
- className="text-brand-300"
- size={18}
- strokeWidth={1}
- />
- </div>
- )}
-
-
-
+ className="flex min-h-[calc(theme(spacing.12)+1px)] flex-wrap items-center justify-between gap-x-4 border-b border-zinc-800 bg-transparent">
+ <div className="flex flex-col items-start w-full">
{hasTabs && (
- <Tab.List className="-mb-px flex gap-4 text-xs font-medium">
+ <Tab.List className="w-full border-b border-white/5 -mb-px flex gap-4 text-xs font-medium">
{Children.map(children, (child, childIndex) => (
<Tab
/* Set ID due to bug in Next https://github.com/vercel/next.js/issues/53110 */
@@ -148,29 +125,50 @@ export function CodeGroupHeader({
gap-1
"
>
- {getPanelTitle(
- isValidElement(child) ? child.props : {},
- ).includes('JavaScript') ? (
- <Image
- src={logoNode}
- alt=""
- className="h-7 w-7"
- unoptimized
- />
- ) : (
- <Image
- src={logoPython}
- alt=""
- className="h-7 w-7"
- unoptimized
- />
- )}
- {getPanelTitle(isValidElement(child) ? child.props : {} as any)}
+ {renderLanguageLogo(isValidElement(child) ? child.props : {})}
+ {extractPanelProps(isValidElement(child) ? child.props : {} as any).language}
</div>
</Tab>
))}
</Tab.List>
)}
+
+ {title && (
+ <div className="flex items-center justify-start space-x-2 p-2">
+ <h3 className="text-xs text-white font-mono">{title}</h3>
+ </div>
+ )}
+
+ {hasTabs && (
+ <>
+ {Children.map(children, (child, childIndex) => (
+ <>
+ {selectedIndex === childIndex && (
+ <>
+ {extractPanelProps(isValidElement(child) ? child.props : {} as any).description && (
+ <span
+ id={`description-${childIndex}`}
+ className="text-xs font-medium text-white font-mono p-2"
+ >
+ {extractPanelProps(isValidElement(child) ? child.props : {} as any).description}
+ </span>
+ )}
+ </>
+ )}
+ </>
+ ))}
+ </>
+ )}
+
+ {isTerminalCommand && (
+ <div className="flex items-center justify-start space-x-2 p-2">
+ <Terminal
+ className="text-white"
+ size={18}
+ />
+ <span className="text-xs font-mono font-medium text-white">Terminal</span>
+ </div>
+ )}
</div>
</div>
)
@@ -384,7 +382,7 @@ export function Pre({
/**
* Special Component just for MDX files, processed by Remark
*/
-export function CodeGroupAutoload({ children, isRunnable = true }) {
+export function CodeGroupAutoload({ children, isRunnable = false }) {
if (!children) {
console.warn(
'CodeGroupAutoload: No children provided - something is wrong with your MDX file',
diff --git a/apps/web/src/components/Concepts.tsx b/apps/web/src/components/Concepts.tsx
new file mode 100644
index 000000000..a0789b11c
--- /dev/null
+++ b/apps/web/src/components/Concepts.tsx
@@ -0,0 +1,42 @@
+import {
+ FolderTree,
+ Terminal,
+ Binary,
+ Hourglass
+} from 'lucide-react'
+
+import {
+ BoxItem,
+ BoxGrid,
+} from '@/components/DocsBox'
+
+const concepts: BoxItem[] = [
+ {
+ href: '/docs/sandbox/lifecycle',
+ title: 'Sandbox lifecycle',
+ description: 'Learn about how to start the sandbox, manage its lifecycle, and interact with it.',
+ icon: <Hourglass strokeWidth={1.5} className="h-5 w-5 transition-colors duration-300 fill-white/10 stroke-zinc-400 group-hover:fill-brand-300/10 group-hover:stroke-brand-400" />,
+ },
+ {
+ href: '/docs/code-execution',
+ title: 'AI code execution',
+ description: 'E2B Sandboxex offer built-in support for running AI-generated Python, JS, TS, and R. You can customize sandbox to run almost any language.',
+ icon: <Binary strokeWidth={1.5} className="h-5 w-5 transition-colors duration-300 fill-white/10 stroke-zinc-400 group-hover:fill-brand-300/10 group-hover:stroke-brand-400" />,
+ },
+ {
+ href: '/docs/filesystem',
+ title: 'Filesystem',
+ description: 'Each sandbox has its own isolated filesystem that you can use to create, read, write, and delete files.',
+ icon: <FolderTree strokeWidth={1.5} className="h-5 w-5 transition-colors duration-300 fill-white/10 stroke-zinc-400 group-hover:fill-brand-300/10 group-hover:stroke-brand-400" />,
+ },
+ {
+ href: '/docs/commands',
+ title: 'Commands',
+ description: 'You can run terminal commands inside the Sandbox. This allows you to start any process inside the Sandbox.',
+ icon: <Terminal strokeWidth={1.5} className="h-5 w-5 transition-colors duration-300 fill-white/10 stroke-zinc-400 group-hover:fill-brand-300/10 group-hover:stroke-brand-400" />,
+ }
+]
+
+export function Concepts() {
+ return <BoxGrid items={concepts} />
+}
diff --git a/apps/web/src/components/Dashboard/Billing.tsx b/apps/web/src/components/Dashboard/Billing.tsx
index 4617607da..d683feb7e 100644
--- a/apps/web/src/components/Dashboard/Billing.tsx
+++ b/apps/web/src/components/Dashboard/Billing.tsx
@@ -3,14 +3,13 @@ import Link from 'next/link'
import { Team, useUser } from '@/utils/useUser'
import { Button } from '../Button'
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from '../ui/table'
-import SwitchToHobbyButton from '@/app/(docs)/docs/pricing/SwitchToHobbyButton'
-import SwitchToProButton from '@/app/(docs)/docs/pricing/SwitchToProButton'
+import SwitchToHobbyButton from '@/components/Pricing/SwitchToHobbyButton'
+import SwitchToProButton from '@/components/Pricing/SwitchToProButton'
function formatCurrency(value: number) {
return value.toLocaleString('en-US', { minimumFractionDigits: 2, maximumFractionDigits: 2 })
}
-
interface Invoice {
cost: number
paid: boolean
diff --git a/apps/web/src/components/DocsBox.tsx b/apps/web/src/components/DocsBox.tsx
new file mode 100644
index 000000000..c0df2a23e
--- /dev/null
+++ b/apps/web/src/components/DocsBox.tsx
@@ -0,0 +1,70 @@
+'use client'
+import { ReactNode } from 'react'
+import Link from 'next/link'
+import { useMotionValue } from 'framer-motion'
+
+export interface BoxItem {
+ href: string
+ title: string
+ description: string
+ icon: ReactNode
+}
+
+function Icon({ icon }: { icon: ReactNode }) {
+ return (
+ <div className="flex h-8 w-8 items-center justify-center rounded-full bg-zinc-900/5 ring-1 ring-zinc-900/25 backdrop-blur-[2px] transition duration-300 group-hover:bg-white/50 group-hover:ring-zinc-900/25 dark:bg-white/7.5 dark:ring-white/15 dark:group-hover:bg-brand-300/10 dark:group-hover:ring-brand-400">
+ {icon}
+ </div>
+ )
+}
+
+export function DocsBox({ item: { href, title, description, icon } }: { item: BoxItem }) {
+ const mouseX = useMotionValue(0)
+ const mouseY = useMotionValue(0)
+
+ function onMouseMove({ currentTarget, clientX, clientY }) {
+ const { left, top } = currentTarget.getBoundingClientRect()
+ mouseX.set(clientX - left)
+ mouseY.set(clientY - top)
+ }
+
+ return (
+ <div
+ key={href}
+ onMouseMove={onMouseMove}
+ className="group relative flex rounded-2xl transition-shadow hover:shadow-md bg-white/2.5 hover:shadow-black/5"
+ >
+ <div
+ className="absolute inset-0 rounded-2xl ring-1 ring-inset ring-white/10 group-hover:ring-white/20" />
+ <div className="relative rounded-2xl px-4 pb-4 pt-16">
+ <Icon icon={icon} />
+ {/* <UseCaseIcon icon={icon} /> */}
+ <h3 className="mt-4 text-sm font-semibold leading-7 text-white">
+ <Link href={href}>
+ <span className="absolute inset-0 rounded-2xl" />
+ {title}
+ </Link>
+ </h3>
+ <p className="mt-1 text-sm text-zinc-400">
+ {description}
+ </p>
+ </div>
+ </div>
+ )
+}
+
+export function BoxGrid({ items }: { items: Array<BoxItem> }) {
+ return (
+ <div className="xl:max-w-none">
+ <div
+ className="not-prose grid grid-cols-1 gap-8 sm:grid-cols-2 xl:grid-cols-4">
+ {items.map(item => (
+ <DocsBox
+ key={item.href}
+ item={item}
+ />
+ ))}
+ </div>
+ </div>
+ )
+}
diff --git a/apps/web/src/components/Navigation/NavigationSubgroup.tsx b/apps/web/src/components/Navigation/NavigationSubgroup.tsx
index 44172e614..f0951c2b8 100644
--- a/apps/web/src/components/Navigation/NavigationSubgroup.tsx
+++ b/apps/web/src/components/Navigation/NavigationSubgroup.tsx
@@ -16,7 +16,10 @@ export function NavigationSubgroup({ subgroup }: { subgroup: NavSubgroup }) {
onClick={toggleExpand}
className="group flex items-center justify-between w-full text-left px-2 py-1 rounded-md hover:bg-zinc-100 dark:hover:bg-zinc-800 transition-colors"
>
- <h3 className="text-sm font-medium text-zinc-400 group-hover:text-white">{subgroup.title}</h3>
+ <div className="flex items-center justify-start gap-1">
+ {subgroup.icon}
+ <h3 className="text-sm font-medium text-zinc-400 group-hover:text-white">{subgroup.title}</h3>
+ </div>
{isExpanded ? (
<ChevronDown className="w-4 h-4 ml-2 text-zinc-400 group-hover:text-white" />
) : (
diff --git a/apps/web/src/components/Navigation/index.tsx b/apps/web/src/components/Navigation/index.tsx
index 92dcab8a1..b825ac2f9 100644
--- a/apps/web/src/components/Navigation/index.tsx
+++ b/apps/web/src/components/Navigation/index.tsx
@@ -1,6 +1,6 @@
'use client'
-import { useRef } from 'react'
+import React, { useRef } from 'react'
import { usePathname } from 'next/navigation'
import clsx from 'clsx'
import {
@@ -55,7 +55,7 @@ function NavigationGroup({ group, className, isLast }: { group: NavGroup; classN
>
<>
{group.items?.map(item => (
- <>
+ <React.Fragment key={item.title}>
{(item as any).links ? (
<NavigationSubgroup subgroup={item as NavSubgroup} />
) : (
@@ -64,7 +64,7 @@ function NavigationGroup({ group, className, isLast }: { group: NavGroup; classN
className="font-medium"
/>
)}
- </>
+ </React.Fragment>
))}
</>
</ul>
@@ -83,7 +83,7 @@ export function Navigation(props) {
<ul role="list">
{routes.map((group, groupIndex) => (
<NavigationGroup
- key={group.title}
+ key={groupIndex}
group={group}
className={groupIndex === 0 ? 'md:mt-0' : undefined}
isLast={groupIndex === routes.length - 1}
diff --git a/apps/web/src/components/Navigation/routes.tsx b/apps/web/src/components/Navigation/routes.tsx
index 6ac54d172..72d716969 100644
--- a/apps/web/src/components/Navigation/routes.tsx
+++ b/apps/web/src/components/Navigation/routes.tsx
@@ -1,35 +1,15 @@
import {
Home,
- // BarChart,
- // FileDown,
- // FileUp,
- // Folder,
- // FolderTree,
- // Hammer,
- // HardDrive,
- // KeyRound,
- // Link,
- // PencilRuler,
- // PlaySquare,
- // RefreshCw,
- // Settings,
- // ShieldQuestion,
- // Terminal,
- // TerminalSquare,
- // Timer,
- // Variable,
- // Wrench,
+ CheckCircle,
+ MessagesSquare,
} from 'lucide-react'
-// import logoNode from '@/images/logos/node.svg'
-// import logoPython from '@/images/logos/python.svg'
-// import Image from 'next/image'
+import logoNode from '@/images/logos/node.svg'
+import logoPython from '@/images/logos/python.svg'
+import Image from 'next/image'
// @ts-ignore; generated by prebuild.ts
-
-
-
// Three parts
//
// 1. Documentation
@@ -65,6 +45,7 @@ export interface NavLink {
export interface NavSubgroup {
title: string
+ icon?: React.ReactNode
links: NavLink[]
}
@@ -72,25 +53,8 @@ export interface NavGroup {
title?: string
icon?: React.ReactNode
items: Array<NavLink | NavSubgroup>
- // links?: NavLink[]
- // subgroups?: NavSubgroup[]
}
-
-// export interface NavGroupWithLinks {
-// title?: string
-// links: NavLink[]
-// subgroups?: never // This ensures that subgroups is not present when links is used
-// }
-
-// export interface NavGroupWithSubgroups {
-// title?: string
-// links?: never // This ensures that links is not present when subgroups is used
-// subgroups: NavSubgroup[]
-// }
-
-// export type NavGroup = NavGroupWithLinks | NavGroupWithSubgroups
-
export const routes: NavGroup[] = [
{
items: [
@@ -99,60 +63,123 @@ export const routes: NavGroup[] = [
href: '/docs',
icon: <Home size={16} />,
},
- ],
- },
- {
- title: 'Quickstart',
- items: [
{
- title: 'Start E2B Sandbox',
- href: '/docs/hello-world/js',
+ title: 'Quickstart',
+ icon: <CheckCircle size={16} />,
+ links: [
+ {
+ title: 'Running your first Sandbox',
+ href: '/docs/quickstart',
+ },
+ {
+ title: '* Connect LLMs to E2B',
+ href: '/docs/quickstart/connect-llms',
+ },
+ {
+ title: '* Upload & download files',
+ href: '/docs/quickstart/upload-download-files',
+ },
+ {
+ title: '* Install custom packages',
+ href: '/docs/quickstart/install-custom-packages',
+ },
+ ],
+ },
+ {
+ title: '* Support',
+ href: '/docs/support',
+ icon: <MessagesSquare size={16} />,
},
- ]
+ ],
},
+ // {
+ // title: 'Quickstart',
+ // items: [
+ // {
+ // title: 'Running your first Sandbox',
+ // href: '/docs/hello-world/js',
+ // },
+ // {
+ // title: 'Connecting LLMs to E2B',
+ // links: [
+ // {
+ // title: 'OpenAI',
+ // href: '/docs/integrations/openai',
+ // },
+ // {
+ // title: 'Anthropic',
+ // href: '/docs/integrations/ai-sdk',
+ // },
+ // {
+ // title: 'Mistral',
+ // href: '/docs/integrations/ai-sdk',
+ // },
+ // {
+ // title: 'Vercel AI SDK',
+ // href: '/docs/integrations/ai-sdk',
+ // },
+ // {
+ // title: 'LangChain',
+ // href: '/docs/integrations/ai-sdk',
+ // },
+ // {
+ // title: 'LlamaIndex',
+ // href: '/docs/integrations/ai-sdk',
+ // },
+ // ],
+ // },
+ // {
+ // title: 'Uploading & downloading files',
+ // href: '/docs/code-execution/python',
+ // },
+ // {
+ // title: 'Install custom packages',
+ // href: '/docs/code-execution/python',
+ // },
+ // ]
+ // },
{
- title: 'Guides', // How to's
+ title: 'Code Interpreting',
items: [
{
- title: 'Execute AI-generated code',
- href: '/docs/a',
- },
- {
- title: 'Install custom packages',
- href: '/docs/b',
- },
- {
- title: 'Set environment variables',
- href: '/docs/c',
+ title: 'Analyze data with AI',
+ href: '/docs/code-interpreting/overview',
},
{
- title: 'Upload & download files',
- href: '/docs/d',
+ title: 'Create charts & visualizations',
+ href: '/docs/code-interpreting/overview',
},
{
- title: 'Customize CPU and RAM',
- href: '/docs/e',
+ title: 'Connect your data',
+ href: '/docs/code-interpreting/overview',
},
- {
- title: 'Set working directory',
- href: '/docs/f',
- },
- {
- title: 'Link specific sandbox with user',
- href: '/docs/g',
- }
]
},
+ // {
+ // title: 'Guides', // How to's
+ // items: [
+ // {
+ // title: 'Set working directory',
+ // href: '/docs/f',
+ // },
+ // {
+ // title: 'Link specific sandbox with user',
+ // href: '/docs/g',
+ // }
+ // ]
+ // },
{
title: 'AI Code Execution',
items: [
{
title: 'Python',
href: '/docs/code-execution/python',
+ icon: <Image src={logoPython} alt="Python" width={20} height={20} />,
},
{
title: 'JavaScript',
href: '/docs/code-execution/python',
+ icon: <Image src={logoNode} alt="JavaScript" width={20} height={20} />,
},
{
title: 'TypeScript',
@@ -163,21 +190,33 @@ export const routes: NavGroup[] = [
href: '/docs/code-execution/python',
},
{
- title: 'AI data analysis',
+ title: 'Web frameworks',
links: [
{
- title: 'Overview',
- href: '/docs/hello-world/py',
+ title: 'Next.js',
+ href: '/docs/code-execution/python',
},
{
- title: 'Data visualization',
- href: '/docs/code-execution/overview',
+ title: 'React',
+ href: '/docs/code-execution/python',
},
{
- title: 'Interactive charts',
- href: '/docs/code-execution/overview',
+ title: 'Svelte',
+ href: '/docs/code-execution/python',
},
- ]
+ {
+ title: 'Vue.js',
+ href: '/docs/code-execution/python',
+ },
+ {
+ title: 'Streamlit',
+ href: '/docs/code-execution/python',
+ },
+ {
+ title: 'Gradio',
+ href: '/docs/code-execution/python',
+ },
+ ],
},
],
},
@@ -192,10 +231,31 @@ export const routes: NavGroup[] = [
title: 'Metadata',
href: '/docs/sandbox/filesystem',
},
+ {
+ title: 'Environment variables',
+ href: '/docs/sandbox/environment-variables',
+ },
+ {
+ title: 'Persistence',
+ href: '/docs/sandbox/persistence',
+ },
{
title: 'Customization',
- href: '/docs/sandbox/customization',
- }
+ links: [
+ {
+ title: 'Overview',
+ href: '/docs/sandbox/custom',
+ },
+ {
+ title: 'CPU & RAM',
+ href: '/docs/sandbox/custom/compute',
+ },
+ {
+ title: 'Preinstall packages (TODO: Better title for custom sandbox templates)',
+ href: '/docs/sandbox/custom/sandbox-template',
+ },
+ ]
+ },
],
},
{
@@ -205,6 +265,22 @@ export const routes: NavGroup[] = [
title: 'Overview',
href: '/docs/filesystem/overview',
},
+ {
+ title: 'Read & write',
+ href: '/docs/filesystem/read-write',
+ },
+ {
+ title: 'Watch directory for changes',
+ href: '/docs/filesystem/watch',
+ },
+ {
+ title: 'Upload data',
+ href: '/docs/filesystem/upload',
+ },
+ {
+ title: 'Download data',
+ href: '/docs/filesystem/download',
+ },
]
},
{
@@ -214,39 +290,51 @@ export const routes: NavGroup[] = [
title: 'Overview',
href: '/docs/process/overview',
},
- ]
- },
- {
- title: 'CLI',
- items: [
{
- title: 'List running sandboxes',
- href: '/docs/cli/list',
+ title: 'Run commands',
+ href: '/docs/process/overview',
},
{
- title: 'Kill all sandboxes',
- href: '/docs/cli/kill-all',
+ title: 'Run commands in background',
+ href: '/docs/process/overview',
},
]
},
{
- // Maybe move integrations to a separate page?
- title: 'Integrations',
+ title: 'CLI',
items: [
{
- title: 'OpenAI',
- href: '/docs/integrations/openai',
+ title: 'Installation',
+ href: '/docs/cli/install',
},
{
- title: 'Vercel AI SDK',
- href: '/docs/integrations/ai-sdk',
+ title: 'List running sandboxes',
+ href: '/docs/cli/list',
},
{
- title: 'Langchain',
- href: '/docs/integrations/ai-sdk',
+ title: 'Shutdown all running sandboxes',
+ href: '/docs/cli/kill-all',
},
]
},
+ // {
+ // // Maybe move integrations to a separate docs page?
+ // title: 'Integrations',
+ // items: [
+ // {
+ // title: 'OpenAI',
+ // href: '/docs/integrations/openai',
+ // },
+ // {
+ // title: 'Vercel AI SDK',
+ // href: '/docs/integrations/ai-sdk',
+ // },
+ // {
+ // title: 'Langchain',
+ // href: '/docs/integrations/ai-sdk',
+ // },
+ // ]
+ // },
// ...apiRefRoutes,
]
diff --git a/apps/web/src/app/(docs)/docs/legacy/pricing/SwitchToHobbyButton.tsx b/apps/web/src/components/Pricing/SwitchToHobbyButton.tsx
similarity index 100%
rename from apps/web/src/app/(docs)/docs/legacy/pricing/SwitchToHobbyButton.tsx
rename to apps/web/src/components/Pricing/SwitchToHobbyButton.tsx
diff --git a/apps/web/src/app/(docs)/docs/legacy/pricing/SwitchToProButton.tsx b/apps/web/src/components/Pricing/SwitchToProButton.tsx
similarity index 100%
rename from apps/web/src/app/(docs)/docs/legacy/pricing/SwitchToProButton.tsx
rename to apps/web/src/components/Pricing/SwitchToProButton.tsx
diff --git a/apps/web/src/app/(docs)/docs/legacy/pricing/TierActiveTag.tsx b/apps/web/src/components/Pricing/TierActiveTag.tsx
similarity index 100%
rename from apps/web/src/app/(docs)/docs/legacy/pricing/TierActiveTag.tsx
rename to apps/web/src/components/Pricing/TierActiveTag.tsx
diff --git a/apps/web/src/components/Quickstart.tsx b/apps/web/src/components/Quickstart.tsx
new file mode 100644
index 000000000..152ac91dd
--- /dev/null
+++ b/apps/web/src/components/Quickstart.tsx
@@ -0,0 +1,42 @@
+import {
+ BrainCircuit,
+ UploadCloud,
+ PlayCircle,
+ PackagePlus,
+} from 'lucide-react'
+
+import {
+ BoxItem,
+ BoxGrid,
+} from '@/components/DocsBox'
+
+const items: BoxItem[] = [
+ {
+ href: '/docs/quickstart',
+ title: 'Running your first Sandbox',
+ description: 'Learn how to start your first E2B Sandbox with our Python or JavaScript SDK.',
+ icon: <PlayCircle strokeWidth={1.5} className="h-5 w-5 transition-colors duration-300 fill-white/10 stroke-zinc-400 group-hover:fill-brand-300/10 group-hover:stroke-brand-400" />,
+ },
+ {
+ href: '/docs/quickstart/connect-llms',
+ title: 'Connecting LLMs to E2B',
+ description: 'Connect your favorite LLM to E2B to run AI-generated code inside the Sandbox.',
+ icon: <BrainCircuit strokeWidth={1.5} className="h-5 w-5 transition-colors duration-300 fill-white/10 stroke-zinc-400 group-hover:fill-brand-300/10 group-hover:stroke-brand-400" />,
+ },
+ {
+ href: '/docs/quickstart/upload-download-files',
+ title: 'Uploading & downloading files',
+ description: 'A quick guide on how to upload and download files to and from the Sandbox.',
+ icon: <UploadCloud strokeWidth={1.5} className="h-5 w-5 transition-colors duration-300 fill-white/10 stroke-zinc-400 group-hover:fill-brand-300/10 group-hover:stroke-brand-400" />,
+ },
+ {
+ href: '/docs/quickstart/install-custom-packages',
+ title: 'Install custom packages',
+ description: 'Customize your Sandbox with third-party packages.',
+ icon: <PackagePlus strokeWidth={1.5} className="h-5 w-5 transition-colors duration-300 fill-white/10 stroke-zinc-400 group-hover:fill-brand-300/10 group-hover:stroke-brand-400" />,
+ },
+]
+
+export function Quickstart() {
+ return <BoxGrid items={items} />
+}
diff --git a/apps/web/src/components/UseCases.tsx b/apps/web/src/components/UseCases.tsx
index 1aca6b7d6..dc9494849 100644
--- a/apps/web/src/components/UseCases.tsx
+++ b/apps/web/src/components/UseCases.tsx
@@ -1,177 +1,27 @@
-'use client'
+import {
+ Binary
+} from 'lucide-react'
-import Link from 'next/link'
-import { motion, useMotionTemplate, useMotionValue } from 'framer-motion'
+import {
+ BoxItem,
+ BoxGrid,
+} from '@/components/DocsBox'
-import { GridPattern } from '@/components/GridPattern'
-import { Heading } from '@/components/Heading'
-import { ChatBubbleIcon } from '@/components/icons/ChatBubbleIcon'
-import { EnvelopeIcon } from '@/components/icons/EnvelopeIcon'
-import { UserIcon } from '@/components/icons/UserIcon'
-import { UsersIcon } from '@/components/icons/UsersIcon'
-
-const useCases = [
- {
- href: '/contacts',
- name: 'Contacts',
- description:
- 'Learn about the contact model and how to create, retrieve, update, delete, and list contacts.',
- icon: UserIcon,
- pattern: {
- y: 16,
- squares: [
- [0, 1],
- [1, 3],
- ],
- },
- },
+const useCases: BoxItem[] = [
{
- href: '/conversations',
- name: 'Conversations',
- description:
- 'Learn about the conversation model and how to create, retrieve, update, delete, and list conversations.',
- icon: ChatBubbleIcon,
- pattern: {
- y: -6,
- squares: [
- [-1, 2],
- [1, 3],
- ],
- },
+ href: '/docs/code-execution',
+ title: 'Build code interpreter',
+ description: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed ut purus eget sapien. Sed ut purus eget sapien.',
+ icon: <Binary strokeWidth={1.5} className="h-5 w-5 transition-colors duration-300 fill-white/10 stroke-zinc-400 group-hover:fill-brand-300/10 group-hover:stroke-brand-400" />,
},
{
- href: '/messages',
- name: 'Messages',
- description:
- 'Learn about the message model and how to create, retrieve, update, delete, and list messages.',
- icon: EnvelopeIcon,
- pattern: {
- y: 32,
- squares: [
- [0, 2],
- [1, 4],
- ],
- },
- },
- {
- href: '/groups',
- name: 'Groups',
- description:
- 'Learn about the group model and how to create, retrieve, update, delete, and list groups.',
- icon: UsersIcon,
- pattern: {
- y: 22,
- squares: [[0, 1]],
- },
+ href: '/docs/data-analysis',
+ title: 'AI data analysis',
+ description: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed ut purus eget sapien. Sed ut purus eget sapien.',
+ icon: <Binary strokeWidth={1.5} className="h-5 w-5 transition-colors duration-300 fill-white/10 stroke-zinc-400 group-hover:fill-brand-300/10 group-hover:stroke-brand-400" />,
},
]
-function UseCaseIcon({ icon: Icon }) {
- return (
- <div
- className="flex h-7 w-7 items-center justify-center rounded-full bg-zinc-900/5 ring-1 ring-zinc-900/25 backdrop-blur-[2px] transition duration-300 group-hover:bg-white/50 group-hover:ring-zinc-900/25 dark:bg-white/7.5 dark:ring-white/15 dark:group-hover:bg-brand-300/10 dark:group-hover:ring-brand-400">
- <Icon
- className="h-5 w-5 fill-zinc-700/10 stroke-zinc-700 transition-colors duration-300 group-hover:stroke-zinc-900 dark:fill-white/10 dark:stroke-zinc-400 dark:group-hover:fill-brand-300/10 dark:group-hover:stroke-brand-400"/>
- </div>
- )
-}
-
-function UseCasePattern({ mouseX, mouseY, ...gridProps }) {
- const maskImage = useMotionTemplate`radial-gradient(180px at ${mouseX}px ${mouseY}px, white, transparent)`
- const style = { maskImage, WebkitMaskImage: maskImage }
-
- return (
- <div className="pointer-events-none">
- <div
- className="absolute inset-0 rounded-2xl transition duration-300 [mask-image:linear-gradient(white,transparent)] group-hover:opacity-50">
- {/* @ts-ignore */}
- <GridPattern
- width={72}
- height={56}
- x="50%"
- className="absolute inset-x-0 inset-y-[-30%] h-[160%] w-full skew-y-[-18deg] fill-black/[0.02] stroke-black/5 dark:fill-white/1 dark:stroke-white/2.5"
- {...gridProps}
- />
- </div>
- <motion.div
- className="absolute inset-0 rounded-2xl bg-gradient-to-r from-[#D7EDEA] to-[#F4FBDF] opacity-0 transition duration-300 group-hover:opacity-100 dark:from-[#202D2E] dark:to-[#303428]"
- style={style}
- />
- <motion.div
- className="absolute inset-0 rounded-2xl opacity-0 mix-blend-overlay transition duration-300 group-hover:opacity-100"
- style={style}
- >
- {/* @ts-ignore */}
- <GridPattern
- width={72}
- height={56}
- x="50%"
- className="absolute inset-x-0 inset-y-[-30%] h-[160%] w-full skew-y-[-18deg] fill-black/50 stroke-black/70 dark:fill-white/2.5 dark:stroke-white/10"
- {...gridProps}
- />
- </motion.div>
- </div>
- )
-}
-
-function UseCase({ useCase }) {
- const mouseX = useMotionValue(0)
- const mouseY = useMotionValue(0)
-
- function onMouseMove({ currentTarget, clientX, clientY }) {
- const { left, top } = currentTarget.getBoundingClientRect()
- mouseX.set(clientX - left)
- mouseY.set(clientY - top)
- }
-
- return (
- <div
- key={useCase.href}
- onMouseMove={onMouseMove}
- className="group relative flex rounded-2xl bg-zinc-50 transition-shadow hover:shadow-md hover:shadow-zinc-900/5 dark:bg-white/2.5 dark:hover:shadow-black/5"
- >
- <UseCasePattern
- {...useCase.pattern}
- mouseX={mouseX}
- mouseY={mouseY}
- />
- <div
- className="absolute inset-0 rounded-2xl ring-1 ring-inset ring-zinc-900/7.5 group-hover:ring-zinc-900/10 dark:ring-white/10 dark:group-hover:ring-white/20"/>
- <div className="relative rounded-2xl px-4 pb-4 pt-16">
- <UseCaseIcon icon={useCase.icon}/>
- <h3 className="mt-4 text-sm font-semibold leading-7 text-zinc-900 dark:text-white">
- <Link href={useCase.href}>
- <span className="absolute inset-0 rounded-2xl"/>
- {useCase.name}
- </Link>
- </h3>
- <p className="mt-1 text-sm text-zinc-600 dark:text-zinc-400">
- {useCase.description}
- </p>
- </div>
- </div>
- )
-}
-
export function UseCases() {
- return (
- <div className="xl:max-w-none">
- <Heading
- /* @ts-ignore */
- level={1}
- id="useCases"
- >
- Use Cases
- </Heading>
- <div
- className="not-prose mt-4 grid grid-cols-1 gap-8 border-t border-zinc-900/5 pt-10 dark:border-white/5 sm:grid-cols-2 xl:grid-cols-4">
- {useCases.map(useCase => (
- <UseCase
- key={useCase.href}
- useCase={useCase}
- />
- ))}
- </div>
- </div>
- )
+ return <BoxGrid items={useCases} />
}