diff --git a/rest_api/config.py b/rest_api/config.py index 72fb0f0d5..56e1e7675 100644 --- a/rest_api/config.py +++ b/rest_api/config.py @@ -1,6 +1,6 @@ import os -PIPELINE_YAML_PATH = os.getenv("PIPELINE_YAML_PATH", "rest_api/pipelines.yaml") +PIPELINE_YAML_PATH = os.getenv("PIPELINE_YAML_PATH", "rest_api/pipeline/pipelines.yaml") QUERY_PIPELINE_NAME = os.getenv("QUERY_PIPELINE_NAME", "query") INDEXING_PIPELINE_NAME = os.getenv("INDEXING_PIPELINE_NAME", "indexing") diff --git a/rest_api/controller/__init__.py b/rest_api/controller/__init__.py index e69de29bb..4b066366a 100644 --- a/rest_api/controller/__init__.py +++ b/rest_api/controller/__init__.py @@ -0,0 +1 @@ +from rest_api.pipeline import custom_component # this import is required for the Custom Components to be registered diff --git a/rest_api/pipeline/custom_component.py b/rest_api/pipeline/custom_component.py new file mode 100644 index 000000000..35dfd97af --- /dev/null +++ b/rest_api/pipeline/custom_component.py @@ -0,0 +1,17 @@ +""" +Pipelines allow putting together Components to build a graph. + +In addition to the standard Haystack Components, custom user-defined Components +can be used in a Pipeline YAML configuration. + +The classes for the Custom Components must be defined in this file. +""" + + +from haystack import BaseComponent + + +class SampleComponent(BaseComponent): + + def run(self, **kwargs): + raise NotImplementedError diff --git a/rest_api/pipelines.yaml b/rest_api/pipeline/pipelines.yaml similarity index 100% rename from rest_api/pipelines.yaml rename to rest_api/pipeline/pipelines.yaml