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(...)`
fix_agent_callbacks
uyhcire 1 year ago committed by GitHub
parent 57e028549a
commit 0a7a2b99b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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

Loading…
Cancel
Save