forked from OpenHands/OpenHands
-
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy patherror.py
More file actions
23 lines (16 loc) · 608 Bytes
/
error.py
File metadata and controls
23 lines (16 loc) · 608 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
from dataclasses import dataclass
from openhands.core.schema import ObservationType
from openhands.events.observation.observation import Observation
@dataclass
class ErrorObservation(Observation):
"""This data class represents an error encountered by the agent.
This is the type of error that LLM can recover from.
E.g., Linter error after editing a file.
"""
observation: str = ObservationType.ERROR
error_id: str = ''
@property
def message(self) -> str:
return self.content
def __str__(self) -> str:
return f'**ErrorObservation**\n{self.content}'