Created
December 1, 2024 19:01
-
-
Save toandaominh1997/73758907cd968bc0295bab9335738b63 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from typing import List, Union, Generator, Iterator | |
import os | |
class Pipeline: | |
def __init__(self): | |
self.index = 0 | |
async def on_startup(self): | |
# This function is called when the server is started. | |
pass | |
async def on_shutdown(self): | |
# This function is called when the server is stopped. | |
pass | |
def pipe( | |
self, user_message: str, model_id: str, messages: List[dict], body: dict | |
) -> Union[str, Generator, Iterator]: | |
self.index += 1 | |
return f"Index at {self.index}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment