class DockerInterpreter(BaseInterpreter):
True
, prompt user before running code strings for security. Defaults to True
.True
, print the standard output of the executed code. Defaults to False
.True
, print the standard error of the executed code. Defaults to True
.def __init__(
self,
require_confirm: bool = True,
print_stdout: bool = False,
print_stderr: bool = True
):
def __del__(self):
def _initialize_if_needed(self):
def _create_file_in_container(self, content: str):
def _run_file_in_container(self, file: Path, code_type: str):
def cleanup(self):
def run(self, code: str, code_type: str = 'python'):
python
)def _check_code_type(self, code_type: str):
def supported_code_types(self):
def update_action_space(self, action_space: Dict[str, Any]):
def execute_command(self, command: str):