Documentation IndexFetch the complete documentation index at: /llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Langchain (Python)
add_texts( texts: Iterable[str], metadatas: Optional[List[dict]] = None, *, ids: Optional[List[str]] = None, **kwargs: Any ) -> List[str]
texts
Iterable[str]
metadatas
Optional[List[dict]]
ids
Optional[List[str]]
**kwargs
Any
List[str]
ValueError
# Add texts with auto-generated IDs texts = ["Document about AI", "Document about ML", "Document about NLP"] ids = store.add_texts(texts) print(f"Added {len(ids)} documents") # Add texts with metadata and custom IDs texts = ["Python tutorial", "JavaScript guide"] metadatas = [ {"language": "python", "level": "beginner"}, {"language": "javascript", "level": "intermediate"} ] custom_ids = ["doc1", "doc2"] ids = store.add_texts(texts, metadatas=metadatas, ids=custom_ids)
Was this page helpful?
Contact support