Attribute | Type | Description |
---|---|---|
content | string | A clear and concise description of the task at hand. |
id | string | A unique string identifier for the task. |
state | Enum | The task states: “OPEN”, “RUNNING”, “DONE”, “FAILED”, “DELETED”. |
type | string | The type of a task. (TODO) |
parent | Task | The parent task. |
subtasks | A list of Task | Subtasks related to the original Task. |
result | string | The Task result. |
Method | Type | Description |
---|---|---|
from_message | classmethod | Load Task from Message. |
to_message | classmethod | Convert Task to Message. |
reset | instance | Reset Task to initial state. |
update_result | instance | Set task result and mark the task as DONE. |
set_id | instance | Set task id. |
set_state | instance | Recursively set the state of the task and its subtasks. |
add_subtask | instance | Add a child task. |
remove_subtask | instance | Delete a subtask by id. |
get_running_task | instance | Get a RUNNING task. |
to_string | instance | Convert task to a string. |
get_result | instance | Get task result as a string. |
decompose | instance | Decompose a task to a list of subtasks. |
compose | instance | Compose task result by subtasks. |
get_depth | instance | Get task depth; root depth is 1. |
Method | Type | Description |
---|---|---|
topological_sort | instance | Sort a list of tasks topologically. |
set_tasks_dependence | instance | Set relationship between root task and other tasks (serial or parallel). |
evolve | instance | Evolve a task to a new task; used for data generation. |