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: Optional[List[dict]] = None,
ids: Optional[List[str]] = None,
*,
batch_size: Optional[int] = None,
batch_concurrency: Optional[int] = None,
overwrite_concurrency: Optional[int] = None,
**kwargs: Any = {}
) -> List[str]Note:
There are constraints on the allowed field names
in the metadata dictionaries, coming from the underlying Astra DB API.
For instance, the $ (dollar sign) cannot be used in the dict keys.
See this document for details:
https://docs.datastax.com/en/astra/astra-db-vector/api-reference/data-api.html
| Name | Type | Description |
|---|---|---|
texts* | Iterable[str] | Texts to add to the vectorstore. |
metadatas | Optional[List[dict]] | Default: NoneOptional list of metadatas. |
ids | Optional[List[str]] | Default: NoneOptional list of ids. |
batch_size | Optional[int] | Default: NoneNumber of documents in each API call. Check the underlying Astra DB HTTP API specs for the max value (20 at the time of writing this). If not provided, defaults to the instance-level setting. |
batch_concurrency | Optional[int] | Default: Nonenumber of threads to process insertion batches concurrently. Defaults to instance-level setting if not provided. |
overwrite_concurrency | Optional[int] | Default: Nonenumber of threads to process pre-existing documents in each batch (which require individual API calls). Defaults to instance-level setting if not provided. |