class TaskPlanningToolkit(BaseToolkit):
A toolkit for task decomposition and re-planning.
def __init__(self, timeout: Optional[float] = None):
Initialize the TaskPlanningToolkit.
Parameters:
None
)def decompose_task(
self,
original_task_content: str,
sub_task_contents: List[str],
original_task_id: Optional[str] = None
):
Use the tool to decompose an original task into several sub-tasks. It creates new Task objects from the provided original task content, used when the original task is complex and needs to be decomposed.
Parameters:
None
)Returns:
List[Task]: A list of newly created sub-task objects.
def replan_tasks(
self,
original_task_content: str,
sub_task_contents: List[str],
original_task_id: Optional[str] = None
):
Use the tool to re_decompose a task into several subTasks. It creates new Task objects from the provided original task content, used when the decomposed tasks are not good enough to help finish the task.
Parameters:
None
)Returns:
List[Task]: Reordered or modified tasks.
def get_tools(self):