itwinai.pipeline
This module provides the functionalities to execute workflows defined in in form of pipelines.
- class itwinai.pipeline.Pipeline(steps: Dict[str, BaseComponent] | Iterable[BaseComponent], name: str | None = None)[source]
Bases:
BaseComponentExecutes a set of components arranged as a pipeline.
- Parameters:
steps (Dict[str, BaseComponent] | Iterable[BaseComponent]) – can be a list or a dictionary of steps of type
BaseComponent.name (str, optional) – name of the pipeline. Defaults to None.
- steps: Dict[str, BaseComponent] | Iterable[BaseComponent]
Pipeline steps. Can be a list of
BaseComponentor a dictionary allowing the user to name eachBaseComponent.
- static validate_args(input_args: Tuple, component: BaseComponent)[source]
Verify that the number of input args provided to some component match with the number of the non-default args in the component.
- Parameters:
input_args (Tuple) – input args to be fed to the component.
component (BaseComponent) – component to be executed.
- Raises:
RuntimeError – in case of args mismatch.