mirror of
https://github.com/open-webui/pipelines
synced 2025-05-13 09:00:53 +00:00
chore: comments
This commit is contained in:
parent
2b7c0e50b2
commit
9f7be02cd9
@ -48,6 +48,7 @@ class Pipeline:
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
async def on_valves_update(self):
|
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)
|
self.client = Anthropic(api_key=self.valves.ANTHROPIC_API_KEY)
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@ -18,13 +18,13 @@ class Pipeline:
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
async def on_startup(self):
|
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__}")
|
print(f"on_startup:{__name__}")
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|
||||||
async def on_shutdown(self):
|
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__}")
|
print(f"on_shutdown:{__name__}")
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@ -14,12 +14,12 @@ class Pipeline:
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
async def on_startup(self):
|
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__}")
|
print(f"on_startup:{__name__}")
|
||||||
pass
|
pass
|
||||||
|
|
||||||
async def on_shutdown(self):
|
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__}")
|
print(f"on_shutdown:{__name__}")
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@ -40,6 +40,8 @@ class Pipeline:
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
async def on_valves_update(self):
|
async def on_valves_update(self):
|
||||||
|
# This function is called when the valves are updated.
|
||||||
|
|
||||||
self.pipelines = self.get_cohere_models()
|
self.pipelines = self.get_cohere_models()
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
@ -14,12 +14,12 @@ class Pipeline:
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
async def on_startup(self):
|
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__}")
|
print(f"on_startup:{__name__}")
|
||||||
pass
|
pass
|
||||||
|
|
||||||
async def on_shutdown(self):
|
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__}")
|
print(f"on_shutdown:{__name__}")
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@ -34,12 +34,12 @@ class Pipeline:
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
async def on_startup(self):
|
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__}")
|
print(f"on_startup:{__name__}")
|
||||||
pass
|
pass
|
||||||
|
|
||||||
async def on_shutdown(self):
|
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__}")
|
print(f"on_shutdown:{__name__}")
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@ -75,7 +75,7 @@ class Pipeline:
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
async def on_shutdown(self):
|
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
|
pass
|
||||||
|
|
||||||
def pipe(
|
def pipe(
|
||||||
|
@ -51,18 +51,20 @@ class Pipeline:
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
async def on_startup(self):
|
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__}")
|
print(f"on_startup:{__name__}")
|
||||||
self.set_langfuse()
|
self.set_langfuse()
|
||||||
pass
|
pass
|
||||||
|
|
||||||
async def on_shutdown(self):
|
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__}")
|
print(f"on_shutdown:{__name__}")
|
||||||
self.langfuse.flush()
|
self.langfuse.flush()
|
||||||
pass
|
pass
|
||||||
|
|
||||||
async def on_valves_update(self):
|
async def on_valves_update(self):
|
||||||
|
# This function is called when the valves are updated.
|
||||||
|
|
||||||
self.set_langfuse()
|
self.set_langfuse()
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@ -29,16 +29,18 @@ class Pipeline:
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
async def on_startup(self):
|
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__}")
|
print(f"on_startup:{__name__}")
|
||||||
pass
|
pass
|
||||||
|
|
||||||
async def on_shutdown(self):
|
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__}")
|
print(f"on_shutdown:{__name__}")
|
||||||
pass
|
pass
|
||||||
|
|
||||||
async def on_valves_update(self):
|
async def on_valves_update(self):
|
||||||
|
# This function is called when the valves are updated.
|
||||||
|
|
||||||
self.pipelines = self.get_litellm_models()
|
self.pipelines = self.get_litellm_models()
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@ class Pipeline:
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
async def on_startup(self):
|
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__}")
|
print(f"on_startup:{__name__}")
|
||||||
|
|
||||||
# Check if the config file exists
|
# Check if the config file exists
|
||||||
@ -67,12 +67,14 @@ class Pipeline:
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
async def on_shutdown(self):
|
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__}")
|
print(f"on_shutdown:{__name__}")
|
||||||
await self.shutdown_litellm_background()
|
await self.shutdown_litellm_background()
|
||||||
pass
|
pass
|
||||||
|
|
||||||
async def on_valves_update(self):
|
async def on_valves_update(self):
|
||||||
|
# This function is called when the valves are updated.
|
||||||
|
|
||||||
print(f"on_valves_update:{__name__}")
|
print(f"on_valves_update:{__name__}")
|
||||||
|
|
||||||
with open(self.valves.LITELLM_CONFIG_DIR, "r") as file:
|
with open(self.valves.LITELLM_CONFIG_DIR, "r") as file:
|
||||||
|
@ -15,7 +15,7 @@ class Pipeline:
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
async def on_startup(self):
|
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__}")
|
print(f"on_startup:{__name__}")
|
||||||
from llama_cpp import Llama
|
from llama_cpp import Llama
|
||||||
|
|
||||||
@ -29,7 +29,7 @@ class Pipeline:
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
async def on_shutdown(self):
|
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__}")
|
print(f"on_shutdown:{__name__}")
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@ -66,7 +66,7 @@ class Pipeline:
|
|||||||
print(self.index)
|
print(self.index)
|
||||||
|
|
||||||
async def on_shutdown(self):
|
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
|
pass
|
||||||
|
|
||||||
def pipe(
|
def pipe(
|
||||||
|
@ -18,7 +18,7 @@ class Pipeline:
|
|||||||
)
|
)
|
||||||
Settings.llm = Ollama(model="llama3")
|
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
|
global documents, index
|
||||||
|
|
||||||
self.documents = SimpleDirectoryReader("./data").load_data()
|
self.documents = SimpleDirectoryReader("./data").load_data()
|
||||||
@ -26,7 +26,7 @@ class Pipeline:
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
async def on_shutdown(self):
|
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
|
pass
|
||||||
|
|
||||||
def pipe(
|
def pipe(
|
||||||
|
@ -17,11 +17,11 @@ class Pipeline:
|
|||||||
|
|
||||||
self.documents = SimpleDirectoryReader("./data").load_data()
|
self.documents = SimpleDirectoryReader("./data").load_data()
|
||||||
self.index = VectorStoreIndex.from_documents(self.documents)
|
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
|
pass
|
||||||
|
|
||||||
async def on_shutdown(self):
|
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
|
pass
|
||||||
|
|
||||||
def pipe(
|
def pipe(
|
||||||
|
@ -30,12 +30,12 @@ class Pipeline:
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
async def on_startup(self):
|
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__}")
|
print(f"on_startup:{__name__}")
|
||||||
pass
|
pass
|
||||||
|
|
||||||
async def on_shutdown(self):
|
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__}")
|
print(f"on_shutdown:{__name__}")
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@ -28,13 +28,13 @@ class Pipeline:
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
async def on_startup(self):
|
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__}")
|
print(f"on_startup:{__name__}")
|
||||||
self.pipelines = self.get_ollama_models()
|
self.pipelines = self.get_ollama_models()
|
||||||
pass
|
pass
|
||||||
|
|
||||||
async def on_shutdown(self):
|
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__}")
|
print(f"on_shutdown:{__name__}")
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@ -14,12 +14,12 @@ class Pipeline:
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
async def on_startup(self):
|
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__}")
|
print(f"on_startup:{__name__}")
|
||||||
pass
|
pass
|
||||||
|
|
||||||
async def on_shutdown(self):
|
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__}")
|
print(f"on_shutdown:{__name__}")
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@ -14,12 +14,12 @@ class Pipeline:
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
async def on_startup(self):
|
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__}")
|
print(f"on_startup:{__name__}")
|
||||||
pass
|
pass
|
||||||
|
|
||||||
async def on_shutdown(self):
|
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__}")
|
print(f"on_shutdown:{__name__}")
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@ -11,12 +11,12 @@ class Pipeline:
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
async def on_startup(self):
|
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__}")
|
print(f"on_startup:{__name__}")
|
||||||
pass
|
pass
|
||||||
|
|
||||||
async def on_shutdown(self):
|
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__}")
|
print(f"on_shutdown:{__name__}")
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@ -47,12 +47,12 @@ class Pipeline:
|
|||||||
self.user_requests = {}
|
self.user_requests = {}
|
||||||
|
|
||||||
async def on_startup(self):
|
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__}")
|
print(f"on_startup:{__name__}")
|
||||||
pass
|
pass
|
||||||
|
|
||||||
async def on_shutdown(self):
|
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__}")
|
print(f"on_shutdown:{__name__}")
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user