Skip to main content

BaseInterpreter

An abstract base class for code interpreters.

run

Executes the given code based on its type. Parameters:
  • code (str): The code to be executed.
  • code_type (str): The type of the code, which must be one of the types returned by supported_code_types().
Returns: str: The result of the code execution. If the execution fails, this should include sufficient information to diagnose and correct the issue.

supported_code_types

Provides supported code types by the interpreter.

update_action_space

Updates action space for python interpreter

execute_command

Executes a command in the interpreter. Parameters:
  • command (str): The command to execute.
Returns: Tuple[str, str]: A tuple containing the stdout and stderr of the command execution.