From fc722a6fa27f39dca18530db4457a5ef1f1426ff Mon Sep 17 00:00:00 2001 From: DrMelone <27028174+Classic298@users.noreply.github.com> Date: Sun, 12 Apr 2026 22:28:28 +0200 Subject: [PATCH] fix: revert merge_docs_to_target_size to sync Caller save_docs_to_vector_db is synchronous, so await inside it is invalid. --- backend/open_webui/routers/retrieval.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/open_webui/routers/retrieval.py b/backend/open_webui/routers/retrieval.py index 2e0cd25ca2..ee8411f970 100644 --- a/backend/open_webui/routers/retrieval.py +++ b/backend/open_webui/routers/retrieval.py @@ -1255,7 +1255,7 @@ def can_merge_chunks(a: Document, b: Document) -> bool: return True -async def merge_docs_to_target_size( +def merge_docs_to_target_size( request: Request, chunks: list[Document], ) -> list[Document]: @@ -1436,7 +1436,7 @@ def save_docs_to_vector_db( docs = split_docs if request.app.state.config.CHUNK_MIN_SIZE_TARGET > 0: - docs = await merge_docs_to_target_size(request, docs) + docs = merge_docs_to_target_size(request, docs) if request.app.state.config.TEXT_SPLITTER in ['', 'character']: text_splitter = RecursiveCharacterTextSplitter(