Skip to main content

execute

Method
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

code
str
required
Code to execute
language
str
default:"'python'"
Programming language **kwargs: Additional execution options

Returns

Returns
Dict[str, Any]
Dictionary with stdout, stderr, return_code, and execution_time