mirror of
https://github.com/All-Hands-AI/OpenHands.git
synced 2026-01-14 09:18:04 -05:00
30 lines
648 B
Python
30 lines
648 B
Python
from dataclasses import dataclass, field
|
|
|
|
from openhands.core.schema import ActionType
|
|
from openhands.events.action.action import Action
|
|
|
|
|
|
@dataclass
|
|
class AddTaskAction(Action):
|
|
parent: str
|
|
goal: str
|
|
subtasks: list = field(default_factory=list)
|
|
thought: str = ''
|
|
action: str = ActionType.ADD_TASK
|
|
|
|
@property
|
|
def message(self) -> str:
|
|
return f'Added task: {self.goal}'
|
|
|
|
|
|
@dataclass
|
|
class ModifyTaskAction(Action):
|
|
task_id: str
|
|
state: str
|
|
thought: str = ''
|
|
action: str = ActionType.MODIFY_TASK
|
|
|
|
@property
|
|
def message(self) -> str:
|
|
return f'Set task {self.task_id} to {self.state}'
|