mirror of
https://github.com/OpenHands/OpenHands.git
synced 2026-03-22 13:47:19 +08:00
* properly log user messages; format browser action/obs, summarize action, messages properly for logging * add source to message * add spaces for printing
22 lines
465 B
Python
22 lines
465 B
Python
from dataclasses import dataclass
|
|
|
|
from opendevin.core.schema import ActionType
|
|
|
|
from .action import Action
|
|
|
|
|
|
@dataclass
|
|
class MessageAction(Action):
|
|
content: str
|
|
wait_for_response: bool = False
|
|
action: str = ActionType.MESSAGE
|
|
|
|
@property
|
|
def message(self) -> str:
|
|
return self.content
|
|
|
|
def __str__(self) -> str:
|
|
ret = f'**MessageAction** (source={self.source})\n'
|
|
ret += f'CONTENT: {self.content}'
|
|
return ret
|