Skip to content

armgit / E2B

Public Imported from GitHub
0

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

Update docs

Vasek Mlejnskyd220d4da7a18
diff --git a/apps/web/src/app/(docs)/docs/code-interpreting/analyze-data/page.mdx b/apps/web/src/app/(docs)/docs/code-interpreting/analyze-data/page.mdx
new file mode 100644
index 000000000..2712c8c7c
--- /dev/null
+++ b/apps/web/src/app/(docs)/docs/code-interpreting/analyze-data/page.mdx
@@ -0,0 +1,7 @@
+# Analyze data with AI
+
+You can use E2B Sandbox to run AI-generated code to analyze data. Here's how the AI data analysis workflow usually looks like:
+1. Your user has a dataset in CSV format or other formats.
+2. You prompt the LLM to generate code (usually Python) based on the user's data.
+3. The sandbox runs the AU-generated code and returns the results.
+4. You display the results to the user.
diff --git a/apps/web/src/app/(docs)/docs/code-interpreting/analyze-data/preinstalled-libraries/page.mdx b/apps/web/src/app/(docs)/docs/code-interpreting/analyze-data/preinstalled-libraries/page.mdx
new file mode 100644
index 000000000..6eadac3bc
--- /dev/null
+++ b/apps/web/src/app/(docs)/docs/code-interpreting/analyze-data/preinstalled-libraries/page.mdx
@@ -0,0 +1,33 @@
+# Pre-installed libraries
+The sandbox comes with a [set of pre-installed Python libraries](https://github.com/e2b-dev/code-interpreter/blob/main/template/requirements.txt) for data analysis
+but you can [install additional packages](/docs/quickstart/install-custom-packages):
+- `aiohttp` (v3.9.3)
+- `beautifulsoup4` (v4.12.3)
+- `bokeh` (v3.3.4)
+- `gensim` (v4.3.2)
+- `imageio` (v2.34.0)
+- `joblib` (v1.3.2)
+- `librosa` (v0.10.1)
+- `matplotlib` (v3.8.3)
+- `nltk` (v3.8.1)
+- `numpy` (v1.26.4)
+- `opencv-python` (v4.9.0.80)
+- `openpyxl` (v3.1.2)
+- `pandas` (v1.5.3)
+- `plotly` (v5.19.0)
+- `pytest` (v8.1.0)
+- `python`-docx (v1.1.0)
+- `pytz` (v2024.1)
+- `requests` (v2.26.0)
+- `scikit-image` (v0.22.0)
+- `scikit-learn` (v1.4.1.post1)
+- `scipy` (v1.12.0)
+- `seaborn` (v0.13.2)
+- `soundfile` (v0.12.1)
+- `spacy` (v3.7.4)
+- `textblob` (v0.18.0)
+- `tornado` (v6.4)
+- `urllib3` (v1.26.7)
+- `xarray` (v2024.2.0)
+- `xlrd` (v2.0.1)
+- `sympy` (v1.12)
diff --git a/apps/web/src/app/(docs)/docs/code-interpreting/supported-languages/bash/page.mdx b/apps/web/src/app/(docs)/docs/code-interpreting/supported-languages/bash/page.mdx
new file mode 100644
index 000000000..0478795a8
--- /dev/null
+++ b/apps/web/src/app/(docs)/docs/code-interpreting/supported-languages/bash/page.mdx
@@ -0,0 +1,19 @@
+# Run bash code
+Use the `runCode`/`run_code` method to run bash code inside the sandbox.
+You'll need to pass the `language` parameter with value `bash`.
+<CodeGroup>
+```js
+import { Sandbox } from '@e2b/code-interpreter'
+
+const sbx = await Sandbox.create()
+const execution = await sbx.runCode('console.log("Hello, world!")', { language: 'bash' })
+console.log(execution)
+```
+```python
+from e2b_code_interpreter import Sandbox
+
+sbx = Sandbox()
+execution = sbx.run_code('console.log("Hello, world!")', { language: 'bash' })
+print(execution)
+```
+</CodeGroup>
\ No newline at end of file
diff --git a/apps/web/src/app/(docs)/docs/code-interpreting/supported-languages/javascript/page.mdx b/apps/web/src/app/(docs)/docs/code-interpreting/supported-languages/javascript/page.mdx
new file mode 100644
index 000000000..00f3a17a0
--- /dev/null
+++ b/apps/web/src/app/(docs)/docs/code-interpreting/supported-languages/javascript/page.mdx
@@ -0,0 +1,19 @@
+# Run JavaScript code
+Use the `runCode`/`run_code` method to run JavaScript code inside the sandbox.
+You'll need to pass the `language` parameter with value `javascript` or `js`.
+<CodeGroup>
+```js
+import { Sandbox } from '@e2b/code-interpreter'
+
+const sbx = await Sandbox.create()
+const execution = await sbx.runCode('console.log("Hello, world!")', { language: 'js' })
+console.log(execution)
+```
+```python
+from e2b_code_interpreter import Sandbox
+
+sbx = Sandbox()
+execution = sbx.run_code('console.log("Hello, world!")', { language: 'js' })
+print(execution)
+```
+</CodeGroup>
\ No newline at end of file
diff --git a/apps/web/src/app/(docs)/docs/code-interpreting/supported-languages/page.mdx b/apps/web/src/app/(docs)/docs/code-interpreting/supported-languages/page.mdx
new file mode 100644
index 000000000..b1b77a598
--- /dev/null
+++ b/apps/web/src/app/(docs)/docs/code-interpreting/supported-languages/page.mdx
@@ -0,0 +1,13 @@
+# Supported languages
+
+Typically you use Python to run AI-generated code for data analysis but you can use other languages as well.
+
+Out of the box E2B Sandbox supports:
+- [Python](/docs/code-interpreting/analyze-data/supported-languages/python)
+- [JavaScript](/docs/code-interpreting/analyze-data/supported-languages/javascript)
+- [R](/docs/code-interpreting/analyze-data/supported-languages/r)
+- [Bash](/docs/code-interpreting/analyze-data/supported-languages/bash)
+
+<Note>
+You can use any custom language runtime by creating a [(todo: link)custom sandbox template]().
+</Note>
diff --git a/apps/web/src/app/(docs)/docs/code-interpreting/supported-languages/python/page.mdx b/apps/web/src/app/(docs)/docs/code-interpreting/supported-languages/python/page.mdx
new file mode 100644
index 000000000..276ccfd65
--- /dev/null
+++ b/apps/web/src/app/(docs)/docs/code-interpreting/supported-languages/python/page.mdx
@@ -0,0 +1,18 @@
+# Run Python code
+Use the `runCode`/`run_code` method to run Python code inside the sandbox.
+<CodeGroup>
+```js
+import { Sandbox } from '@e2b/code-interpreter'
+
+const sbx = await Sandbox.create()
+const execution = await sbx.runCode('print("Hello, world!")')
+console.log(execution)
+```
+```python
+from e2b_code_interpreter import Sandbox
+
+sbx = Sandbox()
+execution = sbx.run_code('print("Hello, world!")')
+print(execution)
+```
+</CodeGroup>
\ No newline at end of file
diff --git a/apps/web/src/app/(docs)/docs/code-interpreting/supported-languages/r/page.mdx b/apps/web/src/app/(docs)/docs/code-interpreting/supported-languages/r/page.mdx
new file mode 100644
index 000000000..d3a9d750c
--- /dev/null
+++ b/apps/web/src/app/(docs)/docs/code-interpreting/supported-languages/r/page.mdx
@@ -0,0 +1,19 @@
+## Run R code
+Use the `runCode`/`run_code` method to run R code inside the sandbox.
+You'll need to pass the `language` parameter with value `r`.
+<CodeGroup>
+```js
+import { Sandbox } from '@e2b/code-interpreter'
+
+const sbx = await Sandbox.create()
+const execution = await sbx.runCode('console.log("Hello, world!")', { language: 'r' })
+console.log(execution)
+```
+```python
+from e2b_code_interpreter import Sandbox
+
+sbx = Sandbox()
+execution = sbx.run_code('console.log("Hello, world!")', { language: 'r' })
+print(execution)
+```
+</CodeGroup>
\ No newline at end of file
diff --git a/apps/web/src/app/(docs)/docs/quickstart/page.mdx b/apps/web/src/app/(docs)/docs/quickstart/page.mdx
index 4bda7b6c3..6242b3767 100644
--- a/apps/web/src/app/(docs)/docs/quickstart/page.mdx
+++ b/apps/web/src/app/(docs)/docs/quickstart/page.mdx
@@ -18,7 +18,7 @@ E2B_API_KEY=e2b_***
</CodeGroup>
-## 3. Install SDK
+## 3. Install E2B SDK
Install the E2B SDK to your project by running the following command in your terminal.
<CodeGroup isTerminalCommand>
```bash {{ language: 'js' }}
diff --git a/apps/web/src/components/Header.tsx b/apps/web/src/components/Header.tsx
index e25d3b635..5130d8441 100644
--- a/apps/web/src/components/Header.tsx
+++ b/apps/web/src/components/Header.tsx
@@ -95,7 +95,7 @@ export const Header = forwardRef(function Header({ className }, ref) {
</Link>
<div className='flex items-center gap-1'>
<DocumentationTypeLink pathname={pathname} href="/docs" title="Documentation" />
- <DocumentationTypeLink pathname={pathname} href="/docs/reference" title="Reference" />
+ <DocumentationTypeLink pathname={pathname} href="/docs/reference" title="* Reference" />
</div>
</div>
{/* {isDocs && <Search />} */}
diff --git a/apps/web/src/components/Navigation/routes.tsx b/apps/web/src/components/Navigation/routes.tsx
index 3845993d6..c7e465a13 100644
--- a/apps/web/src/components/Navigation/routes.tsx
+++ b/apps/web/src/components/Navigation/routes.tsx
@@ -91,7 +91,7 @@ export const routes: NavGroup[] = [
icon: <MessagesSquare size={16} />,
},
{
- title: 'Migrating from SDK v0.* to v1.*',
+ title: '* Migrating from SDK v0.* to v1.*',
href: '/docs/quickstart/migrating-from-v0',
},
],
@@ -147,15 +147,53 @@ export const routes: NavGroup[] = [
items: [
{
title: '* Analyze data with AI',
- href: '/docs/code-interpreting/overview',
+ links: [
+ {
+ title: 'Overview',
+ href: '/docs/code-interpreting/analyze-data',
+ },
+ {
+ title: 'Pre-installed libraries',
+ href: '/docs/code-interpreting/analyze-data/pre-installed-libraries',
+ },
+ {
+ title: '* Example',
+ href: '/docs/code-interpreting/analyze-data/example',
+ },
+ ],
+ },
+ {
+ title: 'Supported languages',
+ links: [
+ {
+ title: 'Overview',
+ href: '/docs/code-interpreting/supported-languages',
+ },
+ {
+ title: 'Python',
+ href: '/docs/code-interpreting/supported-languages/python',
+ },
+ {
+ title: 'JavaScript',
+ href: '/docs/code-interpreting/supported-languages/javascript',
+ },
+ {
+ title: 'R',
+ href: '/docs/code-interpreting/supported-languages/r',
+ },
+ {
+ title: 'Bash',
+ href: '/docs/code-interpreting/supported-languages/bash',
+ },
+ ]
},
{
title: '* Create charts & visualizations',
- href: '/docs/code-interpreting/overview',
+ href: '/docs/code-interpreting/create-charts',
},
{
title: '* Connect your data',
- href: '/docs/code-interpreting/overview',
+ href: '/docs/code-interpreting/connect-your-data',
},
]
},