From 34150fc3ed63821e1a46371bf67c8053bf88efb3 Mon Sep 17 00:00:00 2001 From: Robin Bially Date: Wed, 9 Oct 2024 18:33:39 +0200 Subject: [PATCH] add NO_LIMIT var --- backend/open_webui/apps/retrieval/vector/dbs/qdrant.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/backend/open_webui/apps/retrieval/vector/dbs/qdrant.py b/backend/open_webui/apps/retrieval/vector/dbs/qdrant.py index 2742eb709..70908dc33 100644 --- a/backend/open_webui/apps/retrieval/vector/dbs/qdrant.py +++ b/backend/open_webui/apps/retrieval/vector/dbs/qdrant.py @@ -7,6 +7,8 @@ from qdrant_client.models import models from open_webui.apps.retrieval.vector.main import VectorItem, SearchResult, GetResult from open_webui.config import QDRANT_URI +NO_LIMIT = 999999999 + class QdrantClient: def __init__(self): self.collection_prefix = "open-webui" @@ -73,7 +75,7 @@ class QdrantClient: ) -> Optional[SearchResult]: # Search for the nearest neighbor items based on the vectors and return 'limit' number of results. if limit is None: - limit=10000000 # otherwise qdrant would set limit to 10! + limit = NO_LIMIT # otherwise qdrant would set limit to 10! query_response = self.client.query_points( collection_name=f"{self.collection_prefix}_{collection_name}", @@ -94,7 +96,7 @@ class QdrantClient: return None try: if limit is None: - limit=10000000 # otherwise qdrant would set limit to 10! + limit = NO_LIMIT # otherwise qdrant would set limit to 10! field_conditions = [] for key, value in filter.items(): @@ -115,7 +117,7 @@ class QdrantClient: # Get all the items in the collection. points = self.client.query_points( collection_name=f"{self.collection_prefix}_{collection_name}", - limit=10000000 # default is 10 + limit=NO_LIMIT # otherwise qdrant would set limit to 10! ) return self._result_to_get_result(points.points)