chore: format

This commit is contained in:
Timothy Jaeryang Baek
2026-04-14 17:27:31 -05:00
parent f1be85d997
commit 5dae600ce7
81 changed files with 247 additions and 140 deletions
+2 -6
View File
@@ -506,9 +506,7 @@ async def query_collection_with_hybrid_search(
log.exception(f'Failed to fetch collection {name}: {e}')
return name, None
collection_results = dict(
await asyncio.gather(*(_fetch_collection(name) for name in collection_names))
)
collection_results = dict(await asyncio.gather(*(_fetch_collection(name) for name in collection_names)))
log.info(f'Starting hybrid search for {len(queries)} queries in {len(collection_names)} collections...')
@@ -1153,9 +1151,7 @@ async def get_sources_from_items(
if full_context:
# Sync helper makes blocking VECTOR_DB_CLIENT calls;
# offload so the async caller's event loop stays free.
query_result = await asyncio.to_thread(
get_all_items_from_collections, collection_names
)
query_result = await asyncio.to_thread(get_all_items_from_collections, collection_names)
else:
query_result = await query_collection(
request,
@@ -101,9 +101,7 @@ class AsyncVectorDBClient:
filter: Optional[Dict] = None,
limit: int = 10,
) -> Optional[SearchResult]:
return await asyncio.to_thread(
self._sync.search, collection_name, vectors, filter, limit
)
return await asyncio.to_thread(self._sync.search, collection_name, vectors, filter, limit)
async def query(
self,
@@ -111,9 +109,7 @@ class AsyncVectorDBClient:
filter: Dict,
limit: Optional[int] = None,
) -> Optional[GetResult]:
return await asyncio.to_thread(
self._sync.query, collection_name, filter, limit
)
return await asyncio.to_thread(self._sync.query, collection_name, filter, limit)
async def get(self, collection_name: str) -> Optional[GetResult]:
return await asyncio.to_thread(self._sync.get, collection_name)
@@ -124,9 +120,7 @@ class AsyncVectorDBClient:
ids: Optional[List[str]] = None,
filter: Optional[Dict] = None,
) -> None:
return await asyncio.to_thread(
self._sync.delete, collection_name, ids, filter
)
return await asyncio.to_thread(self._sync.delete, collection_name, ids, filter)
async def reset(self) -> None:
return await asyncio.to_thread(self._sync.reset)
@@ -27,4 +27,3 @@ def process_metadata(
else:
result[key] = sanitize_text_for_db(value)
return result