Skip to content

Commit

Permalink
Remove runCode and runCmd from SDKs (#368)
Browse files Browse the repository at this point in the history
Remove `runCode` and `runCmd` and clean up SDKs files and docs. These
features were not ergonomic and we released a new package
[code-interpreter](https://github.com/e2b-dev/code-interpreter) that
handles this better.

Tasks:
- [x] Fix 404 errors for the deleted pages
  • Loading branch information
ValentaTomas committed May 2, 2024
2 parents 1b4cc69 + cd1002c commit 5e9a986
Show file tree
Hide file tree
Showing 62 changed files with 194 additions and 2,683 deletions.
6 changes: 6 additions & 0 deletions .changeset/late-peas-exist.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@e2b/python-sdk": minor
"e2b": minor
---

Remove runCmd and runCode
30 changes: 0 additions & 30 deletions .devcontainer/devcontainer.json

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/templates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Build and push prepared templates
on:
push:
paths:
- 'sandboxes/**'
- 'templates/**'
- '.github/workflows/templates.yml'
branches:
- main
Expand All @@ -15,7 +15,7 @@ jobs:
buildAndPublish:
defaults:
run:
working-directory: ./sandboxes/base
working-directory: ./templates/base

name: Build and Push Images
runs-on: ubuntu-20.04
Expand Down
20 changes: 12 additions & 8 deletions apps/docs/next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function getFilesHash(rootPath) {

fsWalk.walkSync(rootPath, { stats: true }).forEach(e => {
if (!e.stats.isDirectory()) {
if (e.path.includes(`/node_modules/`)) return // ignore node_modules which may contain symlinks
if (e.path.includes('/node_modules/')) return // ignore node_modules which may contain symlinks
const content = fs.readFileSync(e.path, 'utf8')
processFile(e.path, content)
}
Expand All @@ -54,13 +54,17 @@ const nextConfig = {
return config
},
async rewrites() {
return [
{
source: '/ingest/:path*',
destination: 'https://app.posthog.com/:path*',
// BEWARE: setting basePath will break the analytics proxy
},
]
return {
afterFiles: [
{
source: '/ingest/:path*',
destination: 'https://app.posthog.com/:path*',
// BEWARE: setting basePath will break the analytics proxy
},
{ source: '/:path*', destination: '/_404/:path*' },
]
}

},
async redirects() {
return [
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/src/app/api/cli/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export default function Page() {
const { user, isLoading: userIsLoading } = useUser()
const apiKey = useApiKey()
const searchParams = useSearchParams()
const searchParamsObj = Object.fromEntries(searchParams)
const searchParamsObj = searchParams ? Object.fromEntries(searchParams) : {}
const { next, state } = searchParamsObj

// TODO: Consider sending back onetime code to be used to get access token
Expand Down
4 changes: 2 additions & 2 deletions apps/docs/src/app/code-interpreter/installation/page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ The code generated by LLMs is often split into code blocks, where each subsequen
This 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.

Expand Down Expand Up @@ -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 requirements
Expand Down
Loading

0 comments on commit 5e9a986

Please sign in to comment.