Execute File • AI Agent SDK

execute_file: Execute a file in the sandbox.

execute_file

Async

Method

</div>

This is a method of the SandboxProtocol class in the protocols module.

Execute a file in the sandbox.

Signature

python
async def execute_file(file_path: str, args: Optional[List[str]], limits: Optional[ResourceLimits], env: Optional[Dict[str, str]]) -> SandboxResult

Parameters

ParamField str

Path to file to execute

ParamField Optional

Command line arguments

ParamField Optional[ResourceLimits]

Resource limits for execution

ParamField Optional

Environment variables

Returns

ResponseField SandboxResult

Execution result

Source

View on GitHub

praisonaiagents/sandbox/protocols.py at line 256