Open speleo3 opened 5 days ago
Use a list please. we haven't updated the type hints properly yet, but it just doesn't make sense passing the pagination logic to the implementation in this case
The correct fix here is to update the type signature for add_texts through out the entire code base to force users to use Sequence
for texts, metadata, ids and handle the pagination properly so pagination is not done on the implementation side.
Checked other resources
Example Code
Error Message and Stack Trace (if applicable)
AssertionError
Description
The
VectorStore.add_texts
type annotation fortext
isIterable[str]
. But passing an iterator rather than a sequence is like passing an empty list.https://github.com/langchain-ai/langchain/blob/408a930d559da2fd914f7b1184b099ec6bf30b25/libs/core/langchain_core/vectorstores/base.py#L60-L62
The fix is to replace
texts
withtexts_
on line 104:https://github.com/langchain-ai/langchain/blob/408a930d559da2fd914f7b1184b099ec6bf30b25/libs/core/langchain_core/vectorstores/base.py#L104
System Info
System Information
Package Information
Optional packages not installed
Other Dependencies