Files
OpenHands/opendevin/observation/run.py
Jirka Borovec 0c2ebfd6e1 Ruff: use I rule for isort (#1410)
Ruff: use I rule for isort
2024-04-29 15:41:58 -07:00

26 lines
550 B
Python

from dataclasses import dataclass
from opendevin.schema import ObservationType
from .base import Observation
@dataclass
class CmdOutputObservation(Observation):
"""
This data class represents the output of a command.
"""
command_id: int
command: str
exit_code: int = 0
observation: str = ObservationType.RUN
@property
def error(self) -> bool:
return self.exit_code != 0
@property
def message(self) -> str:
return f'Command `{self.command}` executed with exit code {self.exit_code}.'