diff --git a/backend/open_webui/utils/chat.py b/backend/open_webui/utils/chat.py index 09030b8ee..5c83c6682 100644 --- a/backend/open_webui/utils/chat.py +++ b/backend/open_webui/utils/chat.py @@ -39,11 +39,6 @@ from open_webui.routers.pipelines import ( from open_webui.models.functions import Functions from open_webui.models.models import Models - -from open_webui.utils.plugin import ( - load_function_module_by_id, - get_function_module_from_cache, -) from open_webui.utils.models import get_all_models, check_model_access from open_webui.utils.payload import convert_payload_openai_to_ollama from open_webui.utils.response import ( diff --git a/backend/open_webui/utils/models.py b/backend/open_webui/utils/models.py index bd72639c7..0d2d6bdce 100644 --- a/backend/open_webui/utils/models.py +++ b/backend/open_webui/utils/models.py @@ -302,7 +302,10 @@ async def get_all_models(request, refresh: bool = False, user: UserModel = None) # This ensures each function's DB freshness check runs exactly once, # not once per (model × function) pair. for function_id in all_function_ids: - get_function_module_from_cache(request, function_id) + try: + get_function_module_from_cache(request, function_id) + except Exception as e: + log.info(f"Failed to load function module for {function_id}: {e}") for model in models: action_ids = [ @@ -337,7 +340,7 @@ async def get_all_models(request, refresh: bool = False, user: UserModel = None) if filter_function is None: log.info(f"Filter not found: {filter_id}") continue - + function_module = request.app.state.FUNCTIONS.get(filter_id) if function_module is None: log.info(f"Failed to load filter module: {filter_id}")