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
def execute(code: str, language: str) -> Dict[str, Any]Parameters
ParamField
strCode to execute
ParamField
strProgramming language **kwargs: Additional execution options
Returns
ResponseField
Dict[str, Any]Dictionary with stdout, stderr, return_code, and execution_time
Used By
CodeAgent.execute_codeCodeAgent.aexecuteMiddlewareManager.execute_model_callMiddlewareManager.execute_tool_callfire_hook
Source
View on GitHubpraisonaiagents/agent/code_agent.py at line 221