diff --git a/pipelines/examples/anthropic_manifold_pipeline.py b/pipelines/examples/anthropic_manifold_pipeline.py index a20929a..5ff9636 100644 --- a/pipelines/examples/anthropic_manifold_pipeline.py +++ b/pipelines/examples/anthropic_manifold_pipeline.py @@ -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 diff --git a/pipelines/examples/applescript_pipeline.py b/pipelines/examples/applescript_pipeline.py index 32ec55b..ace7e54 100644 --- a/pipelines/examples/applescript_pipeline.py +++ b/pipelines/examples/applescript_pipeline.py @@ -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 diff --git a/pipelines/examples/azure_openai_pipeline.py b/pipelines/examples/azure_openai_pipeline.py index 335e037..4d741d1 100644 --- a/pipelines/examples/azure_openai_pipeline.py +++ b/pipelines/examples/azure_openai_pipeline.py @@ -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 diff --git a/pipelines/examples/cohere_manifold_pipeline.py b/pipelines/examples/cohere_manifold_pipeline.py index 7cbd121..b4538a2 100644 --- a/pipelines/examples/cohere_manifold_pipeline.py +++ b/pipelines/examples/cohere_manifold_pipeline.py @@ -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 diff --git a/pipelines/examples/example_pipeline.py b/pipelines/examples/example_pipeline.py index aff66ae..e1a4cfc 100644 --- a/pipelines/examples/example_pipeline.py +++ b/pipelines/examples/example_pipeline.py @@ -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 diff --git a/pipelines/examples/filter_pipeline.py b/pipelines/examples/filter_pipeline.py index a13a33d..d376418 100644 --- a/pipelines/examples/filter_pipeline.py +++ b/pipelines/examples/filter_pipeline.py @@ -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 diff --git a/pipelines/examples/haystack_pipeline.py b/pipelines/examples/haystack_pipeline.py index 24211c1..72d1976 100644 --- a/pipelines/examples/haystack_pipeline.py +++ b/pipelines/examples/haystack_pipeline.py @@ -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( diff --git a/pipelines/examples/langfuse_filter_pipeline.py b/pipelines/examples/langfuse_filter_pipeline.py index f1c0336..f6fcc56 100644 --- a/pipelines/examples/langfuse_filter_pipeline.py +++ b/pipelines/examples/langfuse_filter_pipeline.py @@ -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 diff --git a/pipelines/examples/litellm_manifold_pipeline.py b/pipelines/examples/litellm_manifold_pipeline.py index dbe1fe0..df27df8 100644 --- a/pipelines/examples/litellm_manifold_pipeline.py +++ b/pipelines/examples/litellm_manifold_pipeline.py @@ -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 diff --git a/pipelines/examples/litellm_subprocess_manifold_pipeline.py b/pipelines/examples/litellm_subprocess_manifold_pipeline.py index 1f7fef7..97940e9 100644 --- a/pipelines/examples/litellm_subprocess_manifold_pipeline.py +++ b/pipelines/examples/litellm_subprocess_manifold_pipeline.py @@ -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: diff --git a/pipelines/examples/llama_cpp_pipeline.py b/pipelines/examples/llama_cpp_pipeline.py index 97f0614..410ab2a 100644 --- a/pipelines/examples/llama_cpp_pipeline.py +++ b/pipelines/examples/llama_cpp_pipeline.py @@ -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 diff --git a/pipelines/examples/llamaindex_ollama_github_pipeline.py b/pipelines/examples/llamaindex_ollama_github_pipeline.py index afa2224..8dd02ca 100644 --- a/pipelines/examples/llamaindex_ollama_github_pipeline.py +++ b/pipelines/examples/llamaindex_ollama_github_pipeline.py @@ -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( diff --git a/pipelines/examples/llamaindex_ollama_pipeline.py b/pipelines/examples/llamaindex_ollama_pipeline.py index a04004d..c6e12c1 100644 --- a/pipelines/examples/llamaindex_ollama_pipeline.py +++ b/pipelines/examples/llamaindex_ollama_pipeline.py @@ -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( diff --git a/pipelines/examples/llamaindex_pipeline.py b/pipelines/examples/llamaindex_pipeline.py index b76680e..4cb6be3 100644 --- a/pipelines/examples/llamaindex_pipeline.py +++ b/pipelines/examples/llamaindex_pipeline.py @@ -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( diff --git a/pipelines/examples/manifold_pipeline.py b/pipelines/examples/manifold_pipeline.py index 015d447..c968cfe 100644 --- a/pipelines/examples/manifold_pipeline.py +++ b/pipelines/examples/manifold_pipeline.py @@ -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 diff --git a/pipelines/examples/ollama_manifold_pipeline.py b/pipelines/examples/ollama_manifold_pipeline.py index 88d8e15..199947f 100644 --- a/pipelines/examples/ollama_manifold_pipeline.py +++ b/pipelines/examples/ollama_manifold_pipeline.py @@ -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 diff --git a/pipelines/examples/ollama_pipeline.py b/pipelines/examples/ollama_pipeline.py index 78ebdc1..9bebd88 100644 --- a/pipelines/examples/ollama_pipeline.py +++ b/pipelines/examples/ollama_pipeline.py @@ -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 diff --git a/pipelines/examples/openai_pipeline.py b/pipelines/examples/openai_pipeline.py index 036fc3f..4e315de 100644 --- a/pipelines/examples/openai_pipeline.py +++ b/pipelines/examples/openai_pipeline.py @@ -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 diff --git a/pipelines/examples/python_code_pipeline.py b/pipelines/examples/python_code_pipeline.py index ea56f7b..e134d32 100644 --- a/pipelines/examples/python_code_pipeline.py +++ b/pipelines/examples/python_code_pipeline.py @@ -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 diff --git a/pipelines/examples/rate_limit_filter_pipeline.py b/pipelines/examples/rate_limit_filter_pipeline.py index 3422eeb..d66bbc5 100644 --- a/pipelines/examples/rate_limit_filter_pipeline.py +++ b/pipelines/examples/rate_limit_filter_pipeline.py @@ -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