mirror of
https://github.com/open-webui/pipelines
synced 2025-05-13 00:50:44 +00:00
chore: comments
This commit is contained in:
parent
2b7c0e50b2
commit
9f7be02cd9
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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(
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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:
|
||||
|
@ -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
|
||||
|
||||
|
@ -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(
|
||||
|
@ -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(
|
||||
|
@ -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(
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user