Run texts through the embeddings and add them to the vectorstore.
If passing explicit ids, those entries whose id is in the store already will be replaced.
add_texts(
self,
texts: Iterable[str],
metadatas: Iterable[dict] | None = None,
ids: Iterable[str | None] | None = None,
*,
batch_size: int | None = None,
batch_concurrency: int | None = None,
overwrite_concurrency: int | None = None,
**kwargs: Any = {}
) -> list[str]Note:
The allowed field names for the metadata document attributes must obey certain rules (such as: keys cannot start with a dollar sign and cannot be empty). See the document field naming rules.
| Name | Type | Description |
|---|---|---|
texts* | Iterable[str] | Texts to add to the vectorstore. |
metadatas | Iterable[dict] | None | Default: NoneOptional list of metadatas. |
ids | Iterable[str | None] | None | Default: NoneOptional list of ids. |
batch_size | int | None | Default: NoneSize of document chunks for each individual insertion API request. If not provided, defaults to the vector-store overall defaults (which in turn falls to astrapy defaults). |
batch_concurrency | int | None | Default: Nonenumber of threads to process insertion batches concurrently. Defaults to the vector-store overall setting if not provided. |
overwrite_concurrency | int | None | Default: Nonenumber of threads to process pre-existing documents in each batch. Defaults to the vector-store overall setting if not provided. |
**kwargs | Any | Default: {}Additional arguments are ignored. |