Open-source, secure environment with real-world tools for enterprise-grade agents.
Python agentaiai-agentai-agentscode-interpretercopilotdevelopmentdevtoolsgptgpt-4javascriptllmnextjsopenaipythonreactsoftwaretypescript
Remove old code interpreter template and references to it
Tomas Valenta1f8a776c5d42
diff --git a/.github/workflows/templates.yml b/.github/workflows/templates.ymlindex d1f445145..ae8cb1a40 100644--- a/.github/workflows/templates.yml+++ b/.github/workflows/templates.yml@@ -3,7 +3,7 @@ name: Build and push prepared templateson:push:paths:- - 'sandboxes/**'+ - 'templates/**'- '.github/workflows/templates.yml'branches:- main@@ -15,7 +15,7 @@ jobs:buildAndPublish:defaults:run:- working-directory: ./sandboxes/base+ working-directory: ./templates/basename: Build and Push Imagesruns-on: ubuntu-20.04diff --git a/apps/docs/src/app/code-interpreter/installation/page.mdx b/apps/docs/src/app/code-interpreter/installation/page.mdxindex c0f50c639..905a2cafa 100644--- a/apps/docs/src/app/code-interpreter/installation/page.mdx+++ b/apps/docs/src/app/code-interpreter/installation/page.mdx@@ -16,7 +16,7 @@ The code generated by LLMs is often split into code blocks, where each subsequenThis is suboptimal for a lot of Python use cases with LLMs. Especially GPT-3.5 and 4 expects it runs in a Jupyter Notebook environment. Even when ones tries to convince it otherwise. In practice, LLMs will generate code blocks which have references to previous code blocks. This becomes an issue if a user wants to execute each code block separately which often is the use case.This new code interpreter template runs a Jupyter server inside the sandbox, which allows for sharing context between code executions.-Additionally, this new template also partly implements the [Jupyter Kernel messaging protocol](https://jupyter-client.readthedocs.io/en/latest/messaging.html). This means that, for example, support for plotting charts is now improved and we don't need to do hack-ish solutions like [in the current production version](https://github.com/e2b-dev/E2B/blob/main/sandboxes/code-interpreter/e2b_matplotlib_backend.py) of our code interpreter.+Additionally, this new template also partly implements the [Jupyter Kernel messaging protocol](https://jupyter-client.readthedocs.io/en/latest/messaging.html). This means that, for example, support for plotting charts is now improved.The current code interpreter allows to run Python code but each run share the context. That means that subsequent runs can reference to variables, definitions, etc from past code execution runs.@@ -45,7 +45,7 @@ pip install e2b-code-interpreter## Pre-installed packages-The full and always up-to-date list can be found in the [`requirements.txt`](https://github.com/e2b-dev/E2B/blob/stateful-code-interpreter/sandboxes/code-interpreter-stateful/requirements.txt) file.+The full and always up-to-date list can be found in the [`requirements.txt`](https://github.com/e2b-dev/code-interpreter/blob/main/template/requirements.txt) file.```text# Jupyter server requirementsdiff --git a/sandboxes/code-interpreter/README.md b/sandboxes/code-interpreter/README.mddeleted file mode 100644index 3bcc51800..000000000--- a/sandboxes/code-interpreter/README.md+++ /dev/null@@ -1,3 +0,0 @@-# Code Interpreter Sandbox Template--This template is deprecated. Please use the [code-interpreter-sandbox](https://github.com/e2b-dev/code-interpreter) package instead.diff --git a/sandboxes/code-interpreter/e2b.Dockerfile b/sandboxes/code-interpreter/e2b.Dockerfiledeleted file mode 100644index ab07be71f..000000000--- a/sandboxes/code-interpreter/e2b.Dockerfile+++ /dev/null@@ -1,18 +0,0 @@-FROM python:3.11.6--RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get install -y \- build-essential curl git util-linux--ENV PIP_DEFAULT_TIMEOUT=100 \- PIP_DISABLE_PIP_VERSION_CHECK=1 \- PIP_NO_CACHE_DIR=1--WORKDIR /code--COPY ./requirements.txt requirements.txt-RUN pip install -r requirements.txt--RUN mkdir -p /home/user/artifacts--RUN echo "export MPLBACKEND=module://e2b_matplotlib_backend" >>~/.bashrc-COPY e2b_matplotlib_backend.py /usr/local/lib/python3.11/site-packages/e2b_matplotlib_backend.pydiff --git a/sandboxes/code-interpreter/e2b.toml b/sandboxes/code-interpreter/e2b.tomldeleted file mode 100644index 646dc0e37..000000000--- a/sandboxes/code-interpreter/e2b.toml+++ /dev/null@@ -1,13 +0,0 @@-# This is a config for E2B sandbox template.-# You can use 'template_id' (fv7bfqp4wyo42829htzt) from this config to spawn a sandbox:--# Python SDK-# from e2b import Sandbox-# sandbox = Sandbox(template='fv7bfqp4wyo42829htzt')--# JS SDK-# import { Sandbox } from 'e2b'-# const sandbox = await Sandbox.create({ template: 'fv7bfqp4wyo42829htzt' })--dockerfile = "e2b.Dockerfile"-template_id = "fv7bfqp4wyo42829htzt"diff --git a/sandboxes/code-interpreter/e2b_matplotlib_backend.py b/sandboxes/code-interpreter/e2b_matplotlib_backend.pydeleted file mode 100644index f10af0ab6..000000000--- a/sandboxes/code-interpreter/e2b_matplotlib_backend.py+++ /dev/null@@ -1,17 +0,0 @@-from time import strftime--from matplotlib.backend_bases import Gcf-from matplotlib.backends.backend_agg import FigureCanvasAgg-from matplotlib.backend_bases import FigureManagerBase--dateformat = '%Y%m%d-%H%M%S'-FigureCanvas = FigureCanvasAgg--class FigureManager(FigureManagerBase):- def show(self):- self.canvas.figure.savefig(f'/home/user/artifacts/figure_{strftime(dateformat)}.png')---def show(*args, **kwargs):- for _, figmanager in enumerate(Gcf.get_all_fig_managers()):- figmanager.canvas.figure.savefig(f'/home/user/artifacts/figure_{strftime(dateformat)}.png')\ No newline at end of filediff --git a/sandboxes/code-interpreter/requirements.txt b/sandboxes/code-interpreter/requirements.txtdeleted file mode 100644index 290c4ce2c..000000000--- a/sandboxes/code-interpreter/requirements.txt+++ /dev/null@@ -1,29 +0,0 @@-pandas-opencv-python-imageio-scikit-learn-spacy-bokeh-pytest-aiohttp-python-docx-nltk-textblob-beautifulsoup4-seaborn-plotly-tornado-matplotlib-xarray-librosa-gensim-soundfile-pytz-requests-scikit-image-xlrd-scipy-numpy-openpyxl-joblib-urllib3\ No newline at end of filediff --git a/sandboxes/base/e2b.Dockerfile b/templates/base/e2b.Dockerfilesimilarity index 100%rename from sandboxes/base/e2b.Dockerfilerename to templates/base/e2b.Dockerfilediff --git a/sandboxes/base/e2b.toml b/templates/base/e2b.tomlsimilarity index 100%rename from sandboxes/base/e2b.tomlrename to templates/base/e2b.toml