chore: comments

This commit is contained in:
Timothy J. Baek 2024-05-28 18:59:46 -07:00
parent 2b7c0e50b2
commit 9f7be02cd9
20 changed files with 43 additions and 34 deletions

View File

@ -48,6 +48,7 @@ class Pipeline:
pass
async def on_valves_update(self):
# This function is called when the valves are updated.
self.client = Anthropic(api_key=self.valves.ANTHROPIC_API_KEY)
pass

View File

@ -18,13 +18,13 @@ class Pipeline:
pass
async def on_startup(self):
# This function is called when the server is started or after valves are updated.
# 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 or before valves are updated.
# This function is called when the server is stopped.
print(f"on_shutdown:{__name__}")
pass

View File

@ -14,12 +14,12 @@ class Pipeline:
pass
async def on_startup(self):
# This function is called when the server is started or after valves are updated.
# 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 or before valves are updated.
# This function is called when the server is stopped.
print(f"on_shutdown:{__name__}")
pass

View File

@ -40,6 +40,8 @@ class Pipeline:
pass
async def on_valves_update(self):
# This function is called when the valves are updated.
self.pipelines = self.get_cohere_models()
pass

View File

@ -14,12 +14,12 @@ class Pipeline:
pass
async def on_startup(self):
# This function is called when the server is started or after valves are updated.
# 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 or before valves are updated.
# This function is called when the server is stopped.
print(f"on_shutdown:{__name__}")
pass

View File

@ -34,12 +34,12 @@ class Pipeline:
pass
async def on_startup(self):
# This function is called when the server is started or after valves are updated.
# 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 or before valves are updated.
# This function is called when the server is stopped.
print(f"on_shutdown:{__name__}")
pass

View File

@ -75,7 +75,7 @@ class Pipeline:
pass
async def on_shutdown(self):
# This function is called when the server is stopped or before valves are updated.
# This function is called when the server is stopped.
pass
def pipe(

View File

@ -51,18 +51,20 @@ class Pipeline:
pass
async def on_startup(self):
# This function is called when the server is started or after valves are updated.
# This function is called when the server is started.
print(f"on_startup:{__name__}")
self.set_langfuse()
pass
async def on_shutdown(self):
# This function is called when the server is stopped or before valves are updated.
# This function is called when the server is stopped.
print(f"on_shutdown:{__name__}")
self.langfuse.flush()
pass
async def on_valves_update(self):
# This function is called when the valves are updated.
self.set_langfuse()
pass

View File

@ -29,16 +29,18 @@ class Pipeline:
pass
async def on_startup(self):
# This function is called when the server is started or after valves are updated.
# 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 or before valves are updated.
# This function is called when the server is stopped.
print(f"on_shutdown:{__name__}")
pass
async def on_valves_update(self):
# This function is called when the valves are updated.
self.pipelines = self.get_litellm_models()
pass

View File

@ -38,7 +38,7 @@ class Pipeline:
pass
async def on_startup(self):
# This function is called when the server is started or after valves are updated.
# This function is called when the server is started.
print(f"on_startup:{__name__}")
# Check if the config file exists
@ -67,12 +67,14 @@ class Pipeline:
pass
async def on_shutdown(self):
# This function is called when the server is stopped or before valves are updated.
# This function is called when the server is stopped.
print(f"on_shutdown:{__name__}")
await self.shutdown_litellm_background()
pass
async def on_valves_update(self):
# This function is called when the valves are updated.
print(f"on_valves_update:{__name__}")
with open(self.valves.LITELLM_CONFIG_DIR, "r") as file:

View File

@ -15,7 +15,7 @@ class Pipeline:
pass
async def on_startup(self):
# This function is called when the server is started or after valves are updated.
# This function is called when the server is started.
print(f"on_startup:{__name__}")
from llama_cpp import Llama
@ -29,7 +29,7 @@ class Pipeline:
pass
async def on_shutdown(self):
# This function is called when the server is stopped or before valves are updated.
# This function is called when the server is stopped.
print(f"on_shutdown:{__name__}")
pass

View File

@ -66,7 +66,7 @@ class Pipeline:
print(self.index)
async def on_shutdown(self):
# This function is called when the server is stopped or before valves are updated.
# This function is called when the server is stopped.
pass
def pipe(

View File

@ -18,7 +18,7 @@ class Pipeline:
)
Settings.llm = Ollama(model="llama3")
# This function is called when the server is started or after valves are updated.
# This function is called when the server is started.
global documents, index
self.documents = SimpleDirectoryReader("./data").load_data()
@ -26,7 +26,7 @@ class Pipeline:
pass
async def on_shutdown(self):
# This function is called when the server is stopped or before valves are updated.
# This function is called when the server is stopped.
pass
def pipe(

View File

@ -17,11 +17,11 @@ class Pipeline:
self.documents = SimpleDirectoryReader("./data").load_data()
self.index = VectorStoreIndex.from_documents(self.documents)
# This function is called when the server is started or after valves are updated.
# This function is called when the server is started.
pass
async def on_shutdown(self):
# This function is called when the server is stopped or before valves are updated.
# This function is called when the server is stopped.
pass
def pipe(

View File

@ -30,12 +30,12 @@ class Pipeline:
pass
async def on_startup(self):
# This function is called when the server is started or after valves are updated.
# 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 or before valves are updated.
# This function is called when the server is stopped.
print(f"on_shutdown:{__name__}")
pass

View File

@ -28,13 +28,13 @@ class Pipeline:
pass
async def on_startup(self):
# This function is called when the server is started or after valves are updated.
# This function is called when the server is started.
print(f"on_startup:{__name__}")
self.pipelines = self.get_ollama_models()
pass
async def on_shutdown(self):
# This function is called when the server is stopped or before valves are updated.
# This function is called when the server is stopped.
print(f"on_shutdown:{__name__}")
pass

View File

@ -14,12 +14,12 @@ class Pipeline:
pass
async def on_startup(self):
# This function is called when the server is started or after valves are updated.
# 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 or before valves are updated.
# This function is called when the server is stopped.
print(f"on_shutdown:{__name__}")
pass

View File

@ -14,12 +14,12 @@ class Pipeline:
pass
async def on_startup(self):
# This function is called when the server is started or after valves are updated.
# 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 or before valves are updated.
# This function is called when the server is stopped.
print(f"on_shutdown:{__name__}")
pass

View File

@ -11,12 +11,12 @@ class Pipeline:
pass
async def on_startup(self):
# This function is called when the server is started or after valves are updated.
# 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 or before valves are updated.
# This function is called when the server is stopped.
print(f"on_shutdown:{__name__}")
pass

View File

@ -47,12 +47,12 @@ class Pipeline:
self.user_requests = {}
async def on_startup(self):
# This function is called when the server is started or after valves are updated.
# 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 or before valves are updated.
# This function is called when the server is stopped.
print(f"on_shutdown:{__name__}")
pass