Apply patch [skip ci]

This commit is contained in:
open-swe[bot]
2025-09-10 00:01:45 +00:00
parent 94a70cf851
commit 36b5e27ed7

View File

@@ -899,6 +899,32 @@ class Chroma(VectorStore):
)
return [doc for doc, _ in docs_and_scores]
async def asimilarity_search(
self,
query: str,
k: int = DEFAULT_K,
filter: Optional[dict[str, str]] = None, # noqa: A002
**kwargs: Any,
) -> list[Document]:
"""Run similarity search with Chroma asynchronously.
Args:
query: Query text to search for.
k: Number of results to return. Defaults to 4.
filter: Filter by metadata. Defaults to None.
kwargs: Additional keyword arguments to pass to Chroma collection query.
Returns:
List of documents most similar to the query text.
"""
docs_and_scores = await self.asimilarity_search_with_score(
query,
k,
filter=filter,
**kwargs,
)
return [doc for doc, _ in docs_and_scores]
def similarity_search_by_vector(
self,
embedding: list[float],
@@ -1650,3 +1676,4 @@ class Chroma(VectorStore):