from aiforge.core.executor import execute

class Pipeline:
    """The main interface for building and running AIForge pipelines."""

    def __init__(self):
        self.steps = []

    def add(self, op: str, **kwargs):
        """Append an operator and its parameters to the pipeline sequence."""
        self.steps.append((op, kwargs))
        return self

    def run(self, data: any) -> any:
        """Run the accumulated pipeline steps on the given data."""
        return execute(self.steps, data)
