mirror of
https://github.com/All-Hands-AI/OpenHands.git
synced 2026-04-29 03:00:45 -04: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 ''
|