Open-source, secure environment with real-world tools for enterprise-grade agents.
Python agentaiai-agentai-agentscode-interpretercopilotdevelopmentdevtoolsgptgpt-4javascriptllmnextjsopenaipythonreactsoftwaretypescript
Update readme
Tereza Tizkova882ea8546228
diff --git a/README.md b/README.mdindex 0cde069a4..292120b4e 100644--- a/README.md+++ b/README.md@@ -2,20 +2,35 @@<img width="100" src="/readme-assets/logo-circle.png" alt="e2b logo"></p>+<h1 align="center">- Cloud Runtime for AI Agents+ E2B SDK</h1>+<!---<h3 align="center">- Secure sandboxed cloud environments made for AI agents and AI apps+ SDK made to control the E2B Sandboxes - secure cloud environments for running LLM-generated code</h3>+--->+The E2B SDK is made to control the E2B Sandboxes - secure cloud environments for running LLM-generated code. The SDK lets you give your AI app a custom code interpreter.++- ✔️ Works with any LLM and AI framework (see [Cookbook](https://github.com/e2b-dev/e2b-cookbook/tree/main) for examples)+- ✔️ 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))-<h4 align="center">- <a href="https://e2b.dev/docs">Docs</a> |- <a href="https://e2b.dev">Website</a> |- <a href="https://discord.gg/U7KEcGErtQ">Discord</a> |- <a href="https://twitter.com/e2b_dev">Twitter</a>-</h4>++##### 💻 Supported language runtimes+- ✔️ Python+- [(Beta)](https://e2b.dev/docs/guide/beta-code-interpreter-language-runtimes) JavaScript, R, Java+++<!---+<img width="100%" src="/readme-assets/preview.png" alt="Cover image">++---><h4 align="center"><a href="https://pypi.org/project/e2b/">@@ -28,80 +43,90 @@</a></h4>-<img width="100%" src="/readme-assets/preview.png" alt="Cover image">+---+### What is E2B?++[E2B](https://www.e2b.dev/) is an open-source runtime for running AI-generated code in secure cloud Sandboxes. It's tailor-made for agentic & AI use cases.-## What is E2B?+<!---+<h4 align="center">+ <a href="https://e2b.dev/docs">Docs</a> |+ <a href="https://e2b.dev">Website</a> |+ <a href="https://discord.gg/U7KEcGErtQ">Discord</a> |+ <a href="https://twitter.com/e2b_dev">Twitter</a>+</h4>+--->+++<div align='center'>+<!-- <a href="https://e2b.dev/docs" target="_blank">+<img src="https://img.shields.io/badge/docs-%2300acee.svg?color=143D52&style=for-the-badge&logo=x&logoColor=white" alt=docs style="margin-bottom: 5px;"/></a> -->+<a href="https://twitter.com/e2b_dev" target="_blank">+<img src="https://img.shields.io/badge/x (twitter)-%2300acee.svg?color=000000&style=for-the-badge&logo=x&logoColor=white" alt=linkedin style="margin-bottom: 5px;"/></a>+<a href="https://discord.com/invite/U7KEcGErtQ" target="_blank">+<img src="https://img.shields.io/badge/discord -%2300acee.svg?color=143D52&style=for-the-badge&logo=discord&logoColor=white" alt=discord style="margin-bottom: 5px;"/></a>+<a href="https://www.linkedin.com/company/e2b-dev/" target="_blank">+<img src="https://img.shields.io/badge/linkedin-%2300acee.svg?color=000000&style=for-the-badge&logo=linkedin&logoColor=white" alt=linkedin style="margin-bottom: 5px;"/></a>+</div align='center'>-E2B Sandbox is a secure sandboxed cloud environment made for AI agents and AI-apps. Sandboxes allow AI agents and apps to have long running cloud secure-environments. In these environments, large language models can use the same-tools as humans do. For example:+### E2B Sandbox+E2B Sandbox is a secure cloud environment that allows AI agents and apps. You can run multiple instances of Sandboxes, and have long-running sessions. Inside the Sandboxes, LLMs can use the same tools as humans do, e.g.:++- Running LLM generated code- Cloud browsers- GitHub repositories and CLIs- Coding tools like linters, autocomplete, "go-to defintion"-- Running LLM generated code- Audio & video editing-**The E2B sandbox can be connected to any LLM and any AI agent or app.**-------### Code interpreter SDK--We have built a [dedicated SDK](https://github.com/e2b-dev/code-interpreter) for building custom code interpreters in your AI apps. It's build on top of E2B and our core E2B SDK.--### Getting started & documentation-> Please visit [documentation](https://e2b.dev/docs) to get started.+<h1 align="center">+ Start with E2B SDK+</h1>-To create and control a sandbox, you use our SDK:-**Python**+### 1. Install SDK-1. Install SDK+JavaScript/TypeScript+```+npm i @e2b/code-interpreter+```-```bash-pip install e2b+Python+```+pip install e2b_code_interpreter```-2. Start sandbox+### 2. Execute code with code interpreter inside Sandbox-```py-from e2b import Sandbox+**JavaScript**+```ts+import { CodeInterpreter } from '@e2b/code-interpreter'-# Create sandbox-sandbox = Sandbox()+const sandbox = await CodeInterpreter.create()+await sandbox.notebook.execCell('x = 1')-# Let an LLM use the sandbox here-# Visit https://e2b.dev/docs/sandbox/overview to learn more about sandboxes.+const execution = await sandbox.notebook.execCell('x+=1; x')+console.log(execution.text) // outputs 2-# Close sandbox once done-sandbox.close()+await sandbox.close()```-**JavaScript & TypeScript**+**Python**+```py+from e2b_code_interpreter import CodeInterpreter-1. Install SDK+with CodeInterpreter() as sandbox:+ sandbox.notebook.exec_cell("x = 1")-```bash-npm install e2b+ execution = sandbox.notebook.exec_cell("x+=1; x")+ print(execution.text) # outputs 2```-2. Start sandbox--```js-import { Sandbox } from "e2b";--// Create sandbox-const sandbox = await Sandbox.create();+### 3. Hello World guides+Dive depeer and check out the [JavaScript/TypeScript](https://e2b.dev/docs/hello-world/js) and [Python](https://e2b.dev/docs/hello-world/py) "Hello World" guides to learn how to connect code interpreter LLMs.-// Let an LLM use the sandbox here-// Visit https://e2b.dev/docs/sandbox/overview to learn more about sandboxes.--// Close sandbox once done-await sandbox.close();-```+> Please visit [documentation](https://e2b.dev/docs) to get started.## Repository Structure@@ -111,45 +136,3 @@ This repository is a monorepo containing:1. [JS SDK](/packages/js-sdk)1. [CLI](/packages/cli)1. [Documentation](/apps/web/)--## Development--### Generating API clients used by SDKs--E2B SDKs use several API clients generated from OpenAPI and Protobuf specs to manage and interact with sandboxes.-The specs are originally localized in the [infra repo](https://github.com/e2b-dev/infra/) and copied to this repo (./spec) for generating the clients.--To prepare for generating the clients install the following dependencies:--- [Buf CLI](https://buf.build/docs/installation)-- `npm i @connectrpc/protoc-gen-connect-es @bufbuild/protoc-gen-es -g`--#### Generating clients--To generate clients from the [API definitions](./spec/) run the commands from the top level [`Makefile`](./Makefile) after updating the API definitions according to the changes in the definitions from the [infra repo](https://github.com/e2b-dev/infra).--To generate JS & TS clients run:--```bash-make generate-js-```--To generate Python clients run:--```bash-make generate-python-```--This will generate clients for both SDKs from the following specs:--- E2B OpenAPI spec (used for managing sandboxes)- - [Location in infra repo](https://github.com/e2b-dev/infra/blob/main/spec/openapi.yml)- - [Location in E2B repo](./spec/openapi.yml)-- E2B envd [ConnectRPC API](https://connectrpc.com/) spec (used for interacting with the sandbox)- - [Location in infra repo](https://github.com/e2b-dev/infra/blob/main/packages/envd/spec)- - [Location in E2B repo](./spec/envd)-- E2B envd REST API (used for specific interactions with the sandbox like file upload/download)- - [Location in infra repo](https://github.com/e2b-dev/infra/blob/main/packages/envd/spec/envd.yaml)- - [Location in E2B repo](./spec/envd/envd.yaml)--> The API clients are not automatically publicly accessible from the SDK — we are doing some additional work to make the experience of using the APIs better by providing a more user-friendly interface.