From bc64b2a67fddfae13917d8b2f2883c3a2582bb1f Mon Sep 17 00:00:00 2001 From: Phlogi Date: Mon, 31 Mar 2025 15:19:07 +0200 Subject: [PATCH] Fix middleware.py missing prefix on embedding function --- backend/open_webui/utils/middleware.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/open_webui/utils/middleware.py b/backend/open_webui/utils/middleware.py index 8c92dc3cd..5bd0682a2 100644 --- a/backend/open_webui/utils/middleware.py +++ b/backend/open_webui/utils/middleware.py @@ -596,8 +596,8 @@ async def chat_completion_files_handler( request=request, files=files, queries=queries, - embedding_function=lambda query: request.app.state.EMBEDDING_FUNCTION( - query, user=user + embedding_function=lambda query, prefix: request.app.state.EMBEDDING_FUNCTION( + query, prefix=prefix, user=user ), k=request.app.state.config.TOP_K, reranking_function=request.app.state.rf,