diff --git a/.well-known/ai-plugin.json b/.well-known/ai-plugin.json index a62ffba..057ce90 100644 --- a/.well-known/ai-plugin.json +++ b/.well-known/ai-plugin.json @@ -3,7 +3,7 @@ "name_for_human": "E2B code interpreter", "name_for_model": "e2bcodeintepreter", "description_for_human": "Sandboxed cloud environment where you can run any process, use filesystem and access the internet", - "description_for_model": "Plugin for writting and reading files and running processes in a cloud environment.", + "description_for_model": "Plugin for writing and reading files and running processes with access to the internet in a cloud environment.", "auth": { "type": "none" }, diff --git a/README.md b/README.md index 1f799b1..ee9d209 100644 --- a/README.md +++ b/README.md @@ -77,10 +77,12 @@ To install the required packages for this plugin, run the following command: npm install ``` -To run the plugin, enter the following command: +To run the plugin, you will need **API Key**. Click [here](https://e2b.dev/docs?reason=sdk-missing-api-key) to get your API key. + +Then enter the following command: ```bash -npm run dev +E2B_API_KEY=*** npm run dev ``` Once the local server is running: diff --git a/src/index.ts b/src/index.ts index f4a5d39..a170a75 100644 --- a/src/index.ts +++ b/src/index.ts @@ -15,6 +15,9 @@ import { readFileSync } from 'fs' import { RegisterRoutes } from './generated/routes' import { defaultPort } from './constants' +const apiKey = process.env.E2B_API_KEY +if (!apiKey) throw new Error('E2B_API_KEY is not set. Please visit https://e2b.dev/docs?reason=sdk-missing-api-key to get your API key.') + export const app = express() app.use( diff --git a/src/sessions/session.ts b/src/sessions/session.ts index 8fbd761..7d3a6c6 100644 --- a/src/sessions/session.ts +++ b/src/sessions/session.ts @@ -38,6 +38,7 @@ export class CachedSession { constructor(envID: string) { this.session = new Session({ id: envID, + apiKey: process.env.E2B_API_KEY, onClose: () => { this.delete() },