Embed texts and add them to the database.
add_texts(
self,
texts: Iterable[str],
metadatas: Optional[List[dict]] = None,
collection_name: Optional[str] = '',
drop_old: Optional[bool] = False,
**kwargs: Any = {}
) -> List[str]| Name | Type | Description |
|---|---|---|
texts* | Iterable[str] | The texts to embed. |
metadatas | Optional[List[dict]] | Default: NoneMetadata dicts attached to each of the texts. Defaults to None. |
collection_name | Optional[str] | Default: ''Which collection to use. Defaults to "langchain_collection". If provided, default collection name will be set as well. |
drop_old | Optional[bool] | Default: FalseWhether to drop the previous collection and create a new one. Defaults to False. |