execute • AI Agent SDK

execute: Execute code in sandboxed environment.

execute

Method

</div>

This is a method of the CodeAgent class in the code_agent module.

Execute code in sandboxed environment.

Signature

python
def execute(code: str, language: str) -> Dict[str, Any]

Parameters

ParamField str

Code to execute

ParamField str

Programming language **kwargs: Additional execution options

Returns

ResponseField Dict[str, Any]

Dictionary with stdout, stderr, return_code, and execution_time

Used By

Source

View on GitHub

praisonaiagents/agent/code_agent.py at line 221