Skip to content

armgit / E2B

Public Imported from GitHub
0

Open-source, secure environment with real-world tools for enterprise-grade agents.

Add data analysis runtime (#188)

Jakub Novák63ef0de2345d
diff --git a/.changeset/bright-wasps-film.md b/.changeset/bright-wasps-film.md
new file mode 100644
index 000000000..665e8bbef
--- /dev/null
+++ b/.changeset/bright-wasps-film.md
@@ -0,0 +1,6 @@
+---
+'@e2b/python-sdk': patch
+'@e2b/sdk': patch
+---
+
+Add data analysis runtime
diff --git a/packages/js-sdk/src/runCode.ts b/packages/js-sdk/src/runCode.ts
index ee57977cd..f307dc3b5 100644
--- a/packages/js-sdk/src/runCode.ts
+++ b/packages/js-sdk/src/runCode.ts
@@ -4,6 +4,7 @@ export enum CodeRuntime {
Node16 = 'Node16',
Python3 = 'Python3',
Bash = 'Bash',
+ Python3_DataAnalysis = 'Python3_DataAnalysis',
// TODO: Support all runtimes that our infra supports
// DotNET = 'DotNET',
// Go = 'Go',
@@ -47,6 +48,11 @@ export async function runCode(
binary = 'python3'
filepath = '/main.py'
break
+ case CodeRuntime.Python3_DataAnalysis:
+ envID = 'YI58BPyX5KrK'
+ binary = 'python3'
+ filepath = '/main.py'
+ break
case CodeRuntime.Bash:
envID = 'Bash'
binary = 'bash'
diff --git a/packages/python-sdk/e2b/session/run_code.py b/packages/python-sdk/e2b/session/run_code.py
index ec93c1fba..e6c5634a2 100644
--- a/packages/python-sdk/e2b/session/run_code.py
+++ b/packages/python-sdk/e2b/session/run_code.py
@@ -9,6 +9,7 @@ CodeRuntime = Literal[
"Node16",
"Python3",
"Bash",
+ "Python3-DataAnalysis",
# TODO: Support all runtimes that our infra supports
# DotNET = 'DotNET',
# Go = 'Go',
@@ -48,10 +49,14 @@ async def run_code(
env_id = "Python3"
binary = "python3"
filepath = "/index.py"
+ elif runtime == "Python3_DataAnalysis":
+ env_id = "YI58BPyX5KrK"
+ binary = "python3"
+ filepath = "/index.py"
elif runtime == "Bash":
env_id = "Bash"
binary = "bash"
- filepath = "/main.sh"
+ filepath = "/main.sh"
else:
raise UnsupportedRuntimeException(
f'Invalid runtime "{runtime}". Please contact us ([email protected]) if you need support for this runtime'