mirror of
https://github.com/OpenHands/OpenHands.git
synced 2025-12-26 05:48:36 +08:00
34 lines
648 B
Python
34 lines
648 B
Python
from dataclasses import dataclass
|
|
|
|
from opendevin.schema import ObservationType
|
|
|
|
from .base import Observation
|
|
|
|
|
|
@dataclass
|
|
class UserMessageObservation(Observation):
|
|
"""
|
|
This data class represents a message sent by the user.
|
|
"""
|
|
|
|
role: str = 'user'
|
|
observation: str = ObservationType.MESSAGE
|
|
|
|
@property
|
|
def message(self) -> str:
|
|
return ''
|
|
|
|
|
|
@dataclass
|
|
class AgentMessageObservation(Observation):
|
|
"""
|
|
This data class represents a message sent by the agent.
|
|
"""
|
|
|
|
role: str = 'assistant'
|
|
observation: str = ObservationType.MESSAGE
|
|
|
|
@property
|
|
def message(self) -> str:
|
|
return ''
|