This commit is contained in:
Timothy Jaeryang Baek
2026-06-22 16:10:19 +02:00
parent 88901bfa04
commit 223f484ded
6 changed files with 315 additions and 11 deletions
@@ -82,6 +82,10 @@ class AsyncVectorDBClient:
(e.g. already inside a worker thread)."""
return self._sync
@property
def supports_hybrid_search(self) -> bool:
return type(self._sync).hybrid_search is not VectorDBBase.hybrid_search
async def has_collection(self, collection_name: str) -> bool:
return await asyncio.to_thread(self._sync.has_collection, collection_name)
@@ -103,6 +107,25 @@ class AsyncVectorDBClient:
) -> Optional[SearchResult]:
return await asyncio.to_thread(self._sync.search, collection_name, vectors, filter, limit)
async def hybrid_search(
self,
collection_name: str,
query: str,
vectors: List[List[Union[float, int]]],
filter: Optional[Dict] = None,
limit: int = 10,
hybrid_bm25_weight: float = 0.5,
) -> Optional[SearchResult]:
return await asyncio.to_thread(
self._sync.hybrid_search,
collection_name,
query,
vectors,
filter,
limit,
hybrid_bm25_weight,
)
async def query(
self,
collection_name: str,