feat: custom id, name support

This commit is contained in:
Timothy J. Baek 2024-05-21 20:01:08 -07:00
parent a22133b191
commit 97528e2724
3 changed files with 8 additions and 2 deletions

View File

@ -43,8 +43,8 @@ for loaded_module in load_modules_from_directory("./pipelines"):
PIPELINES[loaded_module.__name__] = {
"module": pipeline,
"id": loaded_module.__name__,
"name": loaded_module.__name__,
"id": pipeline.id if hasattr(pipeline, "id") else loaded_module.__name__,
"name": pipeline.name if hasattr(pipeline, "name") else loaded_module.__name__,
}

View File

@ -5,6 +5,9 @@ import requests
class Pipeline:
def __init__(self):
# Optionally, you can set the id and name of the pipeline.
self.id = "openai_pipeline"
self.name = "OpenAI Pipeline"
pass
async def on_startup(self):

View File

@ -4,6 +4,9 @@ from schemas import OpenAIChatMessage
class Pipeline:
def __init__(self):
# Optionally, you can set the id and name of the pipeline.
self.id = "pipeline_example"
self.name = "Pipeline Example"
pass
async def on_startup(self):