Add texts, create embeddings, and add to the Collection and index.
add_texts(
self,
texts: Iterable[str],
metadatas: Optional[List[Dict[str, Any]]] = None,
ids: Optional[List[str]] = None,
batch_size: int = DEFAULT_INSERT_BATCH_SIZE,
**kwargs: Any = {}
) -> List[str]Important notes on ids:
| Name | Type | Description |
|---|---|---|
texts* | Iterable[str] | Iterable of strings to add to the vectorstore. |
metadatas | Optional[List[Dict[str, Any]]] | Default: NoneOptional list of metadatas associated with the texts. |
ids | Optional[List[str]] | Default: NoneOptional list of unique ids that will be used as index in VectorStore. See note on ids. |
batch_size | int | Default: DEFAULT_INSERT_BATCH_SIZENumber of documents to insert at a time. Tuning this may help with performance and sidestep MongoDB limits. |