From 89a234365a27e28c59984f51b6338958e16c4735 Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Sun, 26 May 2024 16:19:47 -0700 Subject: [PATCH] refac --- pipelines/examples/manifold_pipeline.py | 7 ++-- pipelines/manifold_pipeline.py | 46 ------------------------- 2 files changed, 4 insertions(+), 49 deletions(-) delete mode 100644 pipelines/manifold_pipeline.py diff --git a/pipelines/examples/manifold_pipeline.py b/pipelines/examples/manifold_pipeline.py index c1d6934..99e71e2 100644 --- a/pipelines/examples/manifold_pipeline.py +++ b/pipelines/examples/manifold_pipeline.py @@ -4,13 +4,14 @@ from schemas import OpenAIChatMessage class Pipeline: def __init__(self): - self.id = "manifold_pipeline" - # Optionally, you can set the name of the manifold pipeline. - self.name = "Manifold: " # You can also set the pipelines that are available in this pipeline. # Set manifold to True if you want to use this pipeline as a manifold. # Manifold pipelines can have multiple pipelines. self.manifold = True + + self.id = "manifold_pipeline" + # Optionally, you can set the name of the manifold pipeline. + self.name = "Manifold: " self.pipelines = [ { "id": "pipeline-1", # This will turn into `manifold_pipeline.pipeline-1` diff --git a/pipelines/manifold_pipeline.py b/pipelines/manifold_pipeline.py deleted file mode 100644 index c1d6934..0000000 --- a/pipelines/manifold_pipeline.py +++ /dev/null @@ -1,46 +0,0 @@ -from typing import List, Union, Generator, Iterator -from schemas import OpenAIChatMessage - - -class Pipeline: - def __init__(self): - self.id = "manifold_pipeline" - # Optionally, you can set the name of the manifold pipeline. - self.name = "Manifold: " - # You can also set the pipelines that are available in this pipeline. - # Set manifold to True if you want to use this pipeline as a manifold. - # Manifold pipelines can have multiple pipelines. - self.manifold = True - self.pipelines = [ - { - "id": "pipeline-1", # This will turn into `manifold_pipeline.pipeline-1` - "name": "Pipeline 1", # This will turn into `Manifold: Pipeline 1` - }, - { - "id": "pipeline-2", - "name": "Pipeline 2", - }, - ] - pass - - async def on_startup(self): - # This function is called when the server is started. - print(f"on_startup:{__name__}") - pass - - async def on_shutdown(self): - # This function is called when the server is stopped. - print(f"on_shutdown:{__name__}") - pass - - def get_response( - self, user_message: str, model_id: str, messages: List[dict], body: dict - ) -> Union[str, Generator, Iterator]: - # This is where you can add your custom pipelines like RAG.' - print(f"get_response:{__name__}") - - print(messages) - print(user_message) - print(body) - - return f"{model_id} response to: {user_message}"