Timothy Jaeryang Baek 4 months ago
parent
commit
ddfed87b15
2 changed files with 4 additions and 4 deletions
  1. 3 3
      backend/open_webui/functions.py
  2. 1 1
      backend/open_webui/utils/models.py

+ 3 - 3
backend/open_webui/functions.py

@@ -65,12 +65,12 @@ def get_function_module_by_id(request: Request, pipe_id: str):
     return function_module
 
 
-async def get_function_models():
+async def get_function_models(request):
     pipes = Functions.get_functions_by_type("pipe", active_only=True)
     pipe_models = []
 
     for pipe in pipes:
-        function_module = get_function_module_by_id(pipe.id)
+        function_module = get_function_module_by_id(request, pipe.id)
 
         # Check if function is a manifold
         if hasattr(function_module, "pipes"):
@@ -253,7 +253,7 @@ async def generate_function_chat_completion(
         form_data = apply_model_system_prompt_to_body(params, form_data, user)
 
     pipe_id = get_pipe_id(form_data)
-    function_module = get_function_module_by_id(pipe_id)
+    function_module = get_function_module_by_id(request, pipe_id)
 
     pipe = function_module.pipe
     params = get_function_params(function_module, form_data, user, extra_params)

+ 1 - 1
backend/open_webui/utils/models.py

@@ -52,7 +52,7 @@ async def get_all_base_models(request: Request):
             for model in ollama_models["models"]
         ]
 
-    function_models = await get_function_models()
+    function_models = await get_function_models(request)
     models = function_models + openai_models + ollama_models
 
     return models