mirror of
https://github.com/hwchase17/langchain
synced 2024-11-06 03:20:49 +00:00
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:
parent
57e028549a
commit
0a7a2b99b5
@ -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:
|
||||||
|
Loading…
Reference in New Issue
Block a user