Skip to main content

module aixplain.factories.pipeline_factory

Global Variables

  • utils

class PipelineFactory

A static class for creating and exploring Pipeline Objects.

Attributes:

  • backend_url (str): The URL for the backend.

classmethod create

create(
name: str,
pipeline: Union[str, Dict],
api_key: Optional[str] = None
) → Pipeline

Draft Pipeline Creation

Args:

  • name (Text): Pipeline Name
  • pipeline (Union[Text, Dict]): Pipeline as a Python dictionary or in a JSON file
  • api_key (Optional[Text], optional): Team API Key to create the Pipeline. Defaults to None.

Raises:

  • Exception: Currently just the creation of draft pipelines are supported

Returns:

  • Pipeline: instance of the new pipeline

classmethod create_asset_from_id

create_asset_from_id(pipeline_id: str) → Pipeline

classmethod get

get(pipeline_id: str, api_key: Optional[str] = None) → Pipeline

Create a 'Pipeline' object from pipeline id

Args:

  • pipeline_id (Text): Pipeline ID of required pipeline.
  • api_key (Optional[Text], optional): Pipeline API key. Defaults to None.

Returns:

  • Pipeline: Created 'Pipeline' object

classmethod get_assets_from_page

get_assets_from_page(page_number: int) → List[Pipeline]

Get the list of pipelines from a given page

Args:

  • page_number (int): Page from which pipelines are to be listed

Returns:

  • List[Pipeline]: List of pipelines based on given filters

classmethod get_first_k_assets

get_first_k_assets(k: int) → List[Pipeline]

Gets the first k given pipelines based on the provided task and language filters

Args:

  • k (int): Number of pipelines to get

Returns:

  • List[Pipeline]: List of pipelines based on given filters

classmethod init

init(name: str, api_key: Optional[str] = None) → Pipeline

Initialize a new Pipeline

Args:

  • name (Text): Pipeline Name
  • api_key (Optional[Text], optional): Team API Key to create the Pipeline. Defaults to None.

Returns:

  • Pipeline: instance of the new pipeline

classmethod list

list(
query: Optional[str] = None,
functions: Optional[Function, List[Function]] = None,
suppliers: Optional[Supplier, List[Supplier]] = None,
models: Optional[Model, List[Model]] = None,
input_data_types: Optional[DataType, List[DataType]] = None,
output_data_types: Optional[DataType, List[DataType]] = None,
page_number: int = 0,
page_size: int = 20,
drafts_only: bool = False
) → Dict