Open-source, secure environment with real-world tools for enterprise-grade agents.
Python agentaiai-agentai-agentscode-interpretercopilotdevelopmentdevtoolsgptgpt-4javascriptllmnextjsopenaipythonreactsoftwaretypescript
Add guides
Vasek Mlejnsky7159c01bcf6e
diff --git a/apps/web/src/app/(docs)/docs/quickstart/connect-llms/page.mdx b/apps/web/src/app/(docs)/docs/quickstart/connect-llms/page.mdxindex 6024297a5..21db9c8e7 100644--- a/apps/web/src/app/(docs)/docs/quickstart/connect-llms/page.mdx+++ b/apps/web/src/app/(docs)/docs/quickstart/connect-llms/page.mdx@@ -1 +1,67 @@-Connect\ No newline at end of file+# Connect LLMs to E2B+E2B can work with any LLM and AI framework. The easiest way to connect an LLM to E2B is to use the tool use capabilities of the LLM (sometimes known as function calling).++If the LLM doesn't support tool use, you can, for example, prompt the LLM to output code snippets and then manually extract the code snippets with [RegEx](https://en.wikipedia.org/wiki/Regular_expression).++## Contents+- [OpenAI](#openai)+- [Anthropic](#anthropic)+- [Mistral](#mistral)++---++# OpenAI+You can use E2B with all the OpenAI's langauge models.++## o1 family+TODO++## GPT-4 family & GPT-3.5 family+TODO++---++# Anthropic+a++## Claude 3 family & 3.5 family+a++---++# Mistral+a++## Mistral Large & Mistral Small+a++## Codestral+a++---++# Fireworks+++## Llama 3.1 405B Instruct++---++# TogetherAI+a++---++# Vercel AI SDK+Vercel's AI SDK offers support for multiple different LLM providers through a unified JavaScript interface that's easy to use.+++---++# LangChain+LangChain offers support multiple different LLM providers.++---++# LlamaIndex+LlamaIndex offers support multiple different LLM providers.diff --git a/apps/web/src/app/(docs)/docs/quickstart/install-custom-packages/page.mdx b/apps/web/src/app/(docs)/docs/quickstart/install-custom-packages/page.mdxnew file mode 100644index 000000000..d1ed69e3e--- /dev/null+++ b/apps/web/src/app/(docs)/docs/quickstart/install-custom-packages/page.mdx@@ -0,0 +1,16 @@+# Install custom packages++There are two ways to install custom packages in the E2B Sandbox.++1. Create a custom sandbox with [(TODO: link)sandbox template](/todo).+2. Install a package inside the sandbox during the runtime with a package manager of your choice.++---++## 1. Create custom sandbox++Use this option if you know beforehand what packages you need in the sandbox.++++## 2. Install packages during the runtime\ No newline at end of filediff --git a/apps/web/src/app/(docs)/docs/quickstart/migrating-from-v0/page.mdx b/apps/web/src/app/(docs)/docs/quickstart/migrating-from-v0/page.mdxnew file mode 100644index 000000000..852d76ccf--- /dev/null+++ b/apps/web/src/app/(docs)/docs/quickstart/migrating-from-v0/page.mdx@@ -0,0 +1 @@+# TODO: Grit migration guide\ No newline at end of filediff --git a/apps/web/src/app/(docs)/docs/quickstart/upload-download-files/page.mdx b/apps/web/src/app/(docs)/docs/quickstart/upload-download-files/page.mdxnew file mode 100644index 000000000..463acf5d1--- /dev/null+++ b/apps/web/src/app/(docs)/docs/quickstart/upload-download-files/page.mdx@@ -0,0 +1,144 @@+# Upload & downloads files++E2B Sandbox allows you to upload and downloads file to and from the Sandbox.++An alternative way to get your data to the sandbox is to create a [(TODO: link)custom sandbox template]().+++## Upload file+<CodeGroup>+```ts {{ language: 'js' }}+import { Sandbox } from 'e2b'++// Read local file+const content = fs.readFileSync('/local/file')++const sbx = await Sandbox.create()+// Upload file to the sandbox to path '/home/user/my-file'+await sbx.files.write('/home/user/my-file', content)+```++```python {{ language: 'python' }}+from e2b import Sandbox++sbx = Sandbox.create()++# Read local file+with open("/local/file", "rb") as file:+ # Upload file to the sandbox to path '/home/user/my-file'+ sbx.files.write("/home/user/my-file", file)+```+</CodeGroup>+++## Upload multiple files+Currently, if you want to upload multiple files, you need to upload each one of the separately.+We're working on a better solution.++<CodeGroup>+```ts {{ language: 'js' }}+import { Sandbox } from 'e2b'++// Read local files+const fileA = fs.readFileSync('/local/file/a')+const fileB = fs.readFileSync('/local/file/b')++const sbx = await Sandbox.create()+// Upload file A to the sandbox to path '/home/user/my-file-a'+await sbx.files.write('/home/user/my-file-a', content)+// Upload file B to the sandbox to path '/home/user/my-file-b'+await sbx.files.write('/home/user/my-file-b', content)+```++```python {{ language: 'python' }}+from e2b import Sandbox++sbx = Sandbox.create()++# Read local file+with open("/local/file", "rb") as file:+ # Upload file to the sandbox to path '/home/user/my-file'+ sbx.files.write("/home/user/my-file", file)+```+</CodeGroup>+++## Upload directory+We currently don't support an easy way to upload a whole directory.+You need to upload each file separately.++We're working on a better solution.++---++## Download file+To download a file, you need to first get the file's content and then write it to a local file.++<CodeGroup>+```ts {{ language: 'js' }}+import { Sandbox } from 'e2b'++const sbx = await Sandbox.create()+// Download file from the sandbox to path '/home/user/my-file'+const content = await sbx.files.read('/home/user/my-file')+// Write file to local path+fs.writeFileSync('/local/file', content)+```++```python {{ language: 'python' }}+from e2b import Sandbox++sbx = Sandbox.create()+# Download file from the sandbox to path '/home/user/my-file'+content = sbx.files.read('/home/user/my-file')+# Write file to local path+with open('/local/file', 'wb') as file:+ file.write(content)+```+</CodeGroup>++## Download multiple files+To download multiple files, you need to download each one of them separately from the sandbox.++We're working on a better solution.+++<CodeGroup>+```ts {{ language: 'js' }}+import { Sandbox } from 'e2b'++const sbx = await Sandbox.create()+// Download file A from the sandbox to path '/home/user/my-file'+const contentA = await sbx.files.read('/home/user/my-file-a')+// Write file A to local path+fs.writeFileSync('/local/file/a', contentA)++// Download file B from the sandbox to path '/home/user/my-file'+const contentB = await sbx.files.read('/home/user/my-file-b')+// Write file B to local path+fs.writeFileSync('/local/file/b', contentB)+```++```python {{ language: 'python' }}+from e2b import Sandbox++sbx = Sandbox.create()+# Download file A from the sandbox to path '/home/user/my-file-a'+contentA = sbx.files.read('/home/user/my-file-a')+# Write file A to local path+with open('/local/file/a', 'wb') as file:+ file.write(contentA)++# Download file B from the sandbox to path '/home/user/my-file-b'+contentB = sbx.files.read('/home/user/my-file-b')+# Write file B to local path+with open('/local/file/b', 'wb') as file:+ file.write(contentB)+```+</CodeGroup>++## Download directory+We currently don't support an easy way to download a whole directory.+You need to download each file separately.++We're working on a better solution.diff --git a/apps/web/src/components/Navigation/routes.tsx b/apps/web/src/components/Navigation/routes.tsxindex f48838190..bd344b351 100644--- a/apps/web/src/components/Navigation/routes.tsx+++ b/apps/web/src/components/Navigation/routes.tsx@@ -76,7 +76,7 @@ export const routes: NavGroup[] = [href: '/docs/quickstart/connect-llms',},{- title: '* Upload & download files',+ title: 'Upload & download files',href: '/docs/quickstart/upload-download-files',},{@@ -90,6 +90,10 @@ export const routes: NavGroup[] = [href: '/docs/support',icon: <MessagesSquare size={16} />,},+ {+ title: 'Migrating from SDK v0.* to v1.*',+ href: '/docs/quickstart/migrating-from-v0',+ },],},// {@@ -300,6 +304,15 @@ export const routes: NavGroup[] = [},]},+ {+ title: '* Async Python SDK',+ items: [+ {+ title: '* Overview',+ href: '/docs/sdk/overview',+ },+ ]+ },{title: '* CLI',items: [diff --git a/apps/web/src/mdx/remark.mjs b/apps/web/src/mdx/remark.mjsindex 91c9f0243..ec2c81ba2 100644--- a/apps/web/src/mdx/remark.mjs+++ b/apps/web/src/mdx/remark.mjs@@ -1,6 +1,7 @@/* eslint-disable @typescript-eslint/no-unused-vars, quotes */import { mdxAnnotations } from 'mdx-annotations'import remarkGfm from 'remark-gfm'+import remarkToc from 'remark-toc'import { visit } from 'unist-util-visit'import { readFile } from 'fs/promises'import path from 'path'@@ -87,5 +88,5 @@ export const remarkPlugins = [processCodeGroupAutoload,mdxAnnotations.remark,remarkGfm,- loadFileSnippet+ loadFileSnippet,]diff --git a/pnpm-lock.yaml b/pnpm-lock.yamlindex b43bd8cf1..89eb0f8f7 100644--- a/pnpm-lock.yaml+++ b/pnpm-lock.yaml@@ -142,8 +142,8 @@ importers:specifier: ^4.0.8version: 4.0.8lucide-react:- specifier: ^0.268.0- version: 0.268.0([email protected])+ specifier: ^0.452.0+ version: 0.452.0([email protected])mdast-util-to-string:specifier: ^3.2.0version: 3.2.0@@ -4890,7 +4890,7 @@ packages:/@types/[email protected]:resolution: {integrity: sha512-WPs+bbQw5aCj+x6laNGWLH3wviHtoCv/P3+otBhbOhJgG8qtpdAMlTCxLtsTWA7LH1Oh/bFCHsBn0TPS5m30EQ==}dependencies:- '@types/unist': 2.0.8+ '@types/unist': 3.0.3dev: true/@types/[email protected]:@@ -5072,6 +5072,7 @@ packages:/@types/[email protected]:resolution: {integrity: sha512-d0XxK3YTObnWVp6rZuev3c49+j4Lo8g4L1ZRm9z5L0xpoZycUPshHgczK5gsUMaZOstjVYYi09p5gYvUtfChYw==}+ dev: false/@types/[email protected]:resolution: {integrity: sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==}@@ -7519,7 +7520,7 @@ packages:eslint: 8.57.1eslint-import-resolver-node: 0.3.9eslint-import-resolver-typescript: 3.6.0(@typescript-eslint/[email protected])([email protected])([email protected])([email protected])- eslint-plugin-import: 2.28.1(@typescript-eslint/[email protected])([email protected])+ eslint-plugin-import: 2.28.1(@typescript-eslint/[email protected])([email protected])([email protected])eslint-plugin-jsx-a11y: 6.7.1([email protected])eslint-plugin-react: 7.33.2([email protected])eslint-plugin-react-hooks: 4.6.0([email protected])@@ -7550,7 +7551,7 @@ packages:enhanced-resolve: 5.15.0eslint: 8.57.1eslint-module-utils: 2.8.0(@typescript-eslint/[email protected])([email protected])([email protected])([email protected])- eslint-plugin-import: 2.28.1(@typescript-eslint/[email protected])([email protected])+ eslint-plugin-import: 2.28.1(@typescript-eslint/[email protected])([email protected])([email protected])fast-glob: 3.3.1get-tsconfig: 4.7.0is-core-module: 2.13.0@@ -7562,35 +7563,6 @@ packages:- supports-colordev: true- resolution: {integrity: sha512-aWajIYfsqCKRDgUfjEXNN/JlrzauMuSEy5sbd7WXbtW3EH6A6MpwEh42c7qD+MqQo9QMJ6fWLAeIJynx0g6OAw==}- engines: {node: '>=4'}- peerDependencies:- '@typescript-eslint/parser': '*'- eslint: '*'- eslint-import-resolver-node: '*'- eslint-import-resolver-typescript: '*'- eslint-import-resolver-webpack: '*'- peerDependenciesMeta:- '@typescript-eslint/parser':- optional: true- eslint:- optional: true- eslint-import-resolver-node:- optional: true- eslint-import-resolver-typescript:- optional: true- eslint-import-resolver-webpack:- optional: true- dependencies:- '@typescript-eslint/parser': 6.7.2([email protected])([email protected])- debug: 3.2.7- eslint: 8.57.1- eslint-import-resolver-node: 0.3.9- transitivePeerDependencies:- - supports-color- dev: true-/[email protected](@typescript-eslint/[email protected])([email protected])([email protected])([email protected]):resolution: {integrity: sha512-aWajIYfsqCKRDgUfjEXNN/JlrzauMuSEy5sbd7WXbtW3EH6A6MpwEh42c7qD+MqQo9QMJ6fWLAeIJynx0g6OAw==}engines: {node: '>=4'}@@ -7621,7 +7593,7 @@ packages:- supports-colordev: trueresolution: {integrity: sha512-9I9hFlITvOV55alzoKBI+K9q74kv0iKMeY6av5+umsNwayt59fz692daGyjR+oStBQgx6nwR9rXldDev3Clw+A==}engines: {node: '>=4'}peerDependencies:@@ -7631,7 +7603,7 @@ packages:'@typescript-eslint/parser':optional: truedependencies:- '@typescript-eslint/parser': 6.7.2([email protected])([email protected])+ '@typescript-eslint/parser': 6.8.0([email protected])([email protected])array-includes: 3.1.7array.prototype.findlastindex: 1.2.3array.prototype.flat: 1.3.2@@ -7640,7 +7612,7 @@ packages:doctrine: 2.1.0eslint: 8.57.1eslint-import-resolver-node: 0.3.9- eslint-module-utils: 2.8.0(@typescript-eslint/[email protected])([email protected])([email protected])+ eslint-module-utils: 2.8.0(@typescript-eslint/[email protected])([email protected])([email protected])([email protected])has: 1.0.3is-core-module: 2.13.0is-glob: 4.0.3@@ -9269,7 +9241,7 @@ packages:resolution: {integrity: sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg==}engines: {node: '>= 10.13.0'}dependencies:- '@types/node': 18.18.6+ '@types/node': 20.6.3merge-stream: 2.0.0supports-color: 8.1.1dev: false@@ -9696,10 +9668,10 @@ packages:engines: {node: 14 || >=16.14}dev: true- resolution: {integrity: sha512-XP/xY3ASJAViqNqVnDRcEfdxfRB7uNST8sqTLwZhL983ikmHMQ7qQak7ZxrnXOVhB3QDBawdr3ANq0P+iWHP/g==}+ resolution: {integrity: sha512-kNefjOUOGm+Mu3KDiryONyPba9r+nhcrz5oJs3N6JDzGboQNEXw5GB3yB8rnV9/FA4bPyggNU6CRSihZm9MvSw==}peerDependencies:- react: ^16.5.1 || ^17.0.0 || ^18.0.0+ react: ^16.5.1 || ^17.0.0 || ^18.0.0 || ^19.0.0-rcdependencies:react: 18.2.0dev: false