mirror of
https://github.com/OpenHands/OpenHands.git
synced 2026-03-22 13:47:19 +08:00
* action deserializing * add observation deserialization * add tests * refactor agents with serialization * fix some errors * fix lint * fix json parser
17 lines
341 B
Python
17 lines
341 B
Python
from dataclasses import dataclass
|
|
|
|
from .base import Observation
|
|
|
|
@dataclass
|
|
class AgentErrorObservation(Observation):
|
|
"""
|
|
This data class represents an error encountered by the agent.
|
|
"""
|
|
observation : str = "error"
|
|
|
|
@property
|
|
def message(self) -> str:
|
|
return "Oops. Something went wrong: " + self.content
|
|
|
|
|