feat: add support for passing environment variables to E2B sandbox

This commit is contained in:
Yeuoly 2025-12-31 18:07:43 +08:00
parent c9610e9949
commit 41565e91ed

View File

@ -77,6 +77,7 @@ class E2BEnvironment(VirtualEnvironment):
sandbox = Sandbox.create(
template=options.get(self.OptionsKey.E2B_DEFAULT_TEMPLATE, "code-interpreter-v1"),
api_key=options.get(self.OptionsKey.API_KEY, ""),
envs=dict(environments),
)
info = sandbox.get_info(api_key=options.get(self.OptionsKey.API_KEY, ""))
output = sandbox.commands.run("uname -m").stdout.strip()