mirror of
https://github.com/OpenHands/OpenHands.git
synced 2025-12-26 05:48:36 +08:00
* Replace OpenDevin with OpenHands * Update CONTRIBUTING.md * Update README.md * Update README.md * update poetry lock; move opendevin folder to openhands * fix env var * revert image references in docs * revert permissions * revert permissions --------- Co-authored-by: Xingyao Wang <xingyao6@illinois.edu>
30 lines
657 B
Python
30 lines
657 B
Python
from dataclasses import dataclass
|
|
|
|
from openhands.core.schema import ObservationType
|
|
|
|
from .observation import Observation
|
|
|
|
|
|
@dataclass
|
|
class FileReadObservation(Observation):
|
|
"""This data class represents the content of a file."""
|
|
|
|
path: str
|
|
observation: str = ObservationType.READ
|
|
|
|
@property
|
|
def message(self) -> str:
|
|
return f'I read the file {self.path}.'
|
|
|
|
|
|
@dataclass
|
|
class FileWriteObservation(Observation):
|
|
"""This data class represents a file write operation"""
|
|
|
|
path: str
|
|
observation: str = ObservationType.WRITE
|
|
|
|
@property
|
|
def message(self) -> str:
|
|
return f'I wrote to the file {self.path}.'
|