Skip to main content

execute

AsyncMethod
This is a method of the SandboxProtocol class in the protocols module.
Execute code in the sandbox.

Signature

async def execute(code: str, language: str, limits: Optional[ResourceLimits], env: Optional[Dict[str, str]], working_dir: Optional[str]) -> SandboxResult

Parameters

code
str
required
Code to execute
language
str
default:"'python'"
Programming language (python, bash, etc.)
limits
Optional
Resource limits for execution
env
Optional
Environment variables
working_dir
Optional
Working directory for execution

Returns

Returns
SandboxResult
Execution result