fabricatio_tool.capabilities.handle_task

This module contains the HandleTask class, which serves as an abstract base class for handling tasks based on task objects.

It provides a structured mechanism for asynchronous task execution by leveraging code drafting and execution workflows. The class facilitates interaction with various tools, managing their execution lifecycle and workflow.

Classes

HandleTask

A class that handles a task based on a task object, providing extended functionality for processing and execution.

Module Contents

class fabricatio_tool.capabilities.handle_task.HandleTask(/, **data: Any)

Bases: fabricatio_tool.capabilities.handle.Handle, abc.ABC

A class that handles a task based on a task object, providing extended functionality for processing and execution.

This class extends Handle and implements task-specific operations to support complex workflows, including parameter management, tool integration, and result collection.

async handle_task(task: fabricatio_core.Task, data: Dict[str, Any], **kwargs: Unpack[fabricatio_core.models.kwargs_types.ValidateKwargs[str]]) fabricatio_tool.models.collector.ResultCollector | None

Asynchronously handles a task based on a given task object and parameters with enhanced control features.

This method prepares execution parameters and delegates task processing to the fine-grained execution handler. It supports customizable behavior through keyword arguments for both box and tool selection processes.

Parameters:
  • task – The task object containing instructions and metadata for execution.

  • data – A dictionary containing input data for the task.

  • **kwargs – Additional unpacked keyword arguments for customization of execution behavior.

Returns:

An optional ResultCollector instance containing the results of task execution.