Skip to content

Commit

Permalink
Rename base pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
kaancayli committed Feb 15, 2024
1 parent 46c09a5 commit 8cde996
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions app/pipeline/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from domain import IrisMessage, IrisMessageRole


class BasePipeline(metaclass=ABCMeta):
class AbstractPipeline(metaclass=ABCMeta):
"""Abstract class for all pipelines"""

def __init__(self, name=None):
Expand All @@ -19,18 +19,19 @@ def __str__(self):

@abstractmethod
def run(self, *args, **kwargs) -> IrisMessage:
"""Run the pipeline"""
"""Runs the pipeline"""
raise NotImplementedError


class SimplePipeline(BasePipeline):
class SimplePipeline(AbstractPipeline):
"""A simple pipeline that does not have any memory etc."""

def __init__(self, llm, name=None):
super().__init__(name=name)
self.llm = llm
self.pipeline = {"query": itemgetter("query")} | llm | StrOutputParser()

def run(self, *args, query: IrisMessage, **kwargs) -> IrisMessage:
"""A simple pipeline that does not have any memory etc."""
if query is None:
raise ValueError("IrisMessage must not be None")
message = query.text
Expand Down

0 comments on commit 8cde996

Please sign in to comment.