Base Environment¶
- class oscopilot.environments.base_env.BaseEnv[source]¶
Bases:
objectA base class for environments configurations in action-based systems.
This class provides foundational attributes and methods for managing environments, including timeouts, working directories, and environmental states. It is designed to be extended by subclasses that implement specific environments behaviors.
- list_working_dir()[source]¶
Lists the contents of the working directory in a detailed format.
Returns a string representation similar to the output of the ‘ls’ command in Linux, including file/directory names, sizes, and types.
- Returns:
Detailed listings of the working directory’s contents, or an error message if the directory does not exist.
- Return type:
str
- property name¶
The name of the environments.
- Returns:
The name of the environments, typically set to the class name unless overridden in a subclass.
- Return type:
str
- reset()[source]¶
Resets the environments to its initial state.
This method is intended to be implemented by subclasses, defining the specific actions required to reset the environments.
- step(_command) EnvState[source]¶
Executes a command within the environments.
This method is intended to be implemented by subclasses, defining how commands are processed and their effects on the environments state.
- Parameters:
_command – The command to be executed.
- Raises:
NotImplementedError – Indicates that the subclass must implement this method.
- Returns:
The state of the environments after executing the command.
- Return type: