Parcourir la source

Merge pull request #282 from DexterJie/fix-qdrant-client-search-api-deprecation

fix: replace deprecated qdrant_client.search() with recommended API
jjyaoao il y a 5 mois
Parent
commit
bfa64e3d81

+ 3 - 2
Co-creation-projects/YYHDBL-HelloCodeAgentCli/memory/storage/qdrant_store.py

@@ -377,9 +377,9 @@ class QdrantVectorStore:
                 search_params = models.SearchParams(hnsw_ef=self.search_ef, exact=self.search_exact)
                 search_params = models.SearchParams(hnsw_ef=self.search_ef, exact=self.search_exact)
             except Exception:
             except Exception:
                 search_params = None
                 search_params = None
-            search_result = self.client.search(
+            response = self.client.query_points(
                 collection_name=self.collection_name,
                 collection_name=self.collection_name,
-                query_vector=query_vector,
+                query=query_vector,
                 query_filter=query_filter,
                 query_filter=query_filter,
                 limit=limit,
                 limit=limit,
                 score_threshold=score_threshold,
                 score_threshold=score_threshold,
@@ -387,6 +387,7 @@ class QdrantVectorStore:
                 with_vectors=False,
                 with_vectors=False,
                 search_params=search_params
                 search_params=search_params
             )
             )
+            search_result = response.points
             
             
             # 转换结果格式
             # 转换结果格式
             results = []
             results = []