From e6b6f8c44e5c72902020999de7bf335c1a203251 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20=C5=A0ajatovi=C4=87?= Date: Tue, 10 Dec 2024 10:36:15 +0100 Subject: [PATCH] fix(retrievers): fix threshold logic in HybridQdrantInMemoryRetriever --- .../retrievers/hybrid_qdrant_in_memory_retriever.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/intelligence_layer/connectors/retrievers/hybrid_qdrant_in_memory_retriever.py b/src/intelligence_layer/connectors/retrievers/hybrid_qdrant_in_memory_retriever.py index 12d2accd..e8cd68bc 100644 --- a/src/intelligence_layer/connectors/retrievers/hybrid_qdrant_in_memory_retriever.py +++ b/src/intelligence_layer/connectors/retrievers/hybrid_qdrant_in_memory_retriever.py @@ -128,7 +128,6 @@ def get_filtered_documents_with_scores( limit=self._k, filter=filter, with_payload=True, - score_threshold=self._threshold, ) sparse_request = models.SearchRequest( vector=models.NamedSparseVector( @@ -150,7 +149,11 @@ def get_filtered_documents_with_scores( [dense_request_response, sparse_request_response], limit=self._k ) - return [self._point_to_search_result(point) for point in search_result] + return [ + self._point_to_search_result(point) + for point in search_result + if point.score >= self._threshold + ] def get_relevant_documents_with_scores( self, query: str