Run similarity search with Chroma with distance.
similarity_search_with_score(
self,
query: str,
k: int = DEFAULT_K,
filter: dict[str, str] | None = None,
where_document: dict[str, str] | None = None,
**kwargs: Any = {}
) -> list[tuple[Document, float]]| Name | Type | Description |
|---|---|---|
query* | str | Query text to search for. |
k | int | Default: DEFAULT_KNumber of results to return. |
filter | dict[str, str] | None | Default: NoneFilter by metadata. |
where_document | dict[str, str] | None | Default: Nonedict used to filter by document contents. E.g. {"$contains": "hello"}. |
kwargs | Any | Default: {}Additional keyword arguments to pass to Chroma collection query. |