Skip to content

Class swarmauri_core.pipelines.IPipeline.IPipeline

swarmauri_core.pipelines.IPipeline.IPipeline

Bases: ABC

Interface defining core methods for pipeline execution and management.

add_task abstractmethod

add_task(task, *args, **kwargs)

Add a task to the pipeline.

:param task: Callable task to be executed :param args: Positional arguments for the task :param kwargs: Keyword arguments for the task

Source code in swarmauri_core/pipelines/IPipeline.py
23
24
25
26
27
28
29
30
31
32
@abstractmethod
def add_task(self, task: Callable, *args: Any, **kwargs: Any) -> None:
    """
    Add a task to the pipeline.

    :param task: Callable task to be executed
    :param args: Positional arguments for the task
    :param kwargs: Keyword arguments for the task
    """
    pass

execute abstractmethod

execute(*args, **kwargs)

Execute the entire pipeline.

:return: List of results from pipeline execution

Source code in swarmauri_core/pipelines/IPipeline.py
34
35
36
37
38
39
40
41
@abstractmethod
def execute(self, *args: Any, **kwargs: Any) -> List[Any]:
    """
    Execute the entire pipeline.

    :return: List of results from pipeline execution
    """
    pass

get_status abstractmethod

get_status()

Get the current status of the pipeline.

:return: Current pipeline status

Source code in swarmauri_core/pipelines/IPipeline.py
43
44
45
46
47
48
49
50
@abstractmethod
def get_status(self) -> PipelineStatus:
    """
    Get the current status of the pipeline.

    :return: Current pipeline status
    """
    pass

reset abstractmethod

reset()

Reset the pipeline to its initial state.

Source code in swarmauri_core/pipelines/IPipeline.py
52
53
54
55
56
57
@abstractmethod
def reset(self) -> None:
    """
    Reset the pipeline to its initial state.
    """
    pass