Open-source, secure environment with real-world tools for enterprise-grade agents.
Python agentaiai-agentai-agentscode-interpretercopilotdevelopmentdevtoolsgptgpt-4javascriptllmnextjsopenaipythonreactsoftwaretypescript
Add data analysis runtime (#188)
Jakub Novák63ef0de2345d
diff --git a/.changeset/bright-wasps-film.md b/.changeset/bright-wasps-film.mdnew file mode 100644index 000000000..665e8bbef--- /dev/null+++ b/.changeset/bright-wasps-film.md@@ -0,0 +1,6 @@+---+'@e2b/python-sdk': patch+'@e2b/sdk': patch+---++Add data analysis runtimediff --git a/packages/js-sdk/src/runCode.ts b/packages/js-sdk/src/runCode.tsindex 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'+ breakcase 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.pyindex 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'