From 91f22a8a8d54399a7616ca69ce28846b74723056 Mon Sep 17 00:00:00 2001 From: "zhiguo.qiao" Date: Tue, 7 Jan 2025 17:41:30 +0800 Subject: [PATCH] Return the top k results with the highest similarity. --- backend/open_webui/retrieval/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/open_webui/retrieval/utils.py b/backend/open_webui/retrieval/utils.py index c95367e6c..7e7abaf93 100644 --- a/backend/open_webui/retrieval/utils.py +++ b/backend/open_webui/retrieval/utils.py @@ -199,7 +199,7 @@ def query_collection( else: pass - return merge_and_sort_query_results(results, k=k) + return merge_and_sort_query_results(results, k=k, reverse=True) def query_collection_with_hybrid_search(