execute • AI Agent SDK
execute: Execute code in the sandbox.
execute
Async
Method
</div>
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]) -> SandboxResultParameters
ParamField
strCode to execute
ParamField
strProgramming language (python, bash, etc.)
ParamField
Optional[ResourceLimits]Resource limits for execution
ParamField
OptionalEnvironment variables
ParamField
Optional[str]Working directory for execution
Returns
ResponseField
SandboxResultExecution result
Used By
CodeAgent.execute_codeCodeAgent.aexecuteMiddlewareManager.execute_model_callMiddlewareManager.execute_tool_callfire_hook
Source
View on GitHubpraisonaiagents/sandbox/protocols.py at line 234