Fix Chroma integration failing when there are less than 4 items in the collection (#3674)

The code was failing to decrement the `n_results` kwarg passed to
`query(...)`
This commit is contained in:
uyhcire 2023-04-28 21:18:19 -07:00 committed by GitHub
parent 57e028549a
commit 0a7a2b99b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -111,7 +111,7 @@ class Chroma(VectorStore):
return self._collection.query( return self._collection.query(
query_texts=query_texts, query_texts=query_texts,
query_embeddings=query_embeddings, query_embeddings=query_embeddings,
n_results=n_results, n_results=i,
where=where, where=where,
) )
except chromadb.errors.NotEnoughElementsException: except chromadb.errors.NotEnoughElementsException: