class CodeExecutionToolkit(BaseToolkit):
subprocess
)False
)True
, the interpreter runs the code by eval()
without any security check. (default: :obj:False
)None
)False
)def __init__(
self,
sandbox: Literal['internal_python', 'jupyter', 'docker', 'subprocess', 'e2b'] = 'subprocess',
verbose: bool = False,
unsafe_mode: bool = False,
import_white_list: Optional[List[str]] = None,
require_confirm: bool = False,
timeout: Optional[float] = None
):
def execute_code(self, code: str, code_type: str = 'python'):
python
)def execute_command(self, command: str):
def get_tools(self):