diff --git a/01_pipeline_tester.py b/01_pipeline_tester.py new file mode 100644 index 0000000..9eb9b98 --- /dev/null +++ b/01_pipeline_tester.py @@ -0,0 +1,23 @@ +from typing import List, Union, Generator, Iterator + +class Pipeline: + def __init__(self): + self.name = "Simple pipeline tester" + 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 shutdown. + print(f"on_shutdown:{__name__}") + pass + + + def pipe(self, user_message: str, model_id: str, messages: List[dict], body: dict) -> Union[str, Generator, Iterator]: + # This function is called when a new user_message is receieved. + + print(f"received message from user: {user_message}") #user_message to logs + return (f"received message from user: {user_message}") #user_message to the UI \ No newline at end of file diff --git a/README.md b/README.md index 70bdb37..a4febaf 100644 --- a/README.md +++ b/README.md @@ -2,4 +2,5 @@ These python scripts are meant as a pipeline between Openweb UI and Openrouter -1. 00: Queries a openrouter model and returns the response to the chat \ No newline at end of file +1. 00: Queries a openrouter model and returns the response to the chat +2. 01: Simple Echo example \ No newline at end of file