Create a Chroma vectorstore from a list of documents.
If a persist_directory is specified, the collection will be persisted there. Otherwise, the data will be ephemeral in-memory.
from_documents(
cls: Type[Chroma],
documents: List[Document],
embedding: Optional[Embeddings] = None,
ids: Optional[List[str]] = None,
collection_name: str = _LANGCHAIN_DEFAULT_COLLECTION_NAME,
persist_directory: Optional[str] = None,
client_settings: Optional[chromadb.config.Settings] = None,
client: Optional[chromadb.Client] = None,
collection_metadata: Optional[Dict] = None,
**kwargs: Any = {}
) -> Chroma| Name | Type | Description |
|---|---|---|
collection_name | str | Default: _LANGCHAIN_DEFAULT_COLLECTION_NAMEName of the collection to create. |
persist_directory | Optional[str] | Default: NoneDirectory to persist the collection. |
ids | Optional[List[str]] | Default: NoneList of document IDs. Defaults to None. |
documents* | List[Document] | List of documents to add to the vectorstore. |
embedding | Optional[Embeddings] | Default: NoneEmbedding function. Defaults to None. |
client_settings | Optional[chromadb.config.Settings] | Default: NoneChroma client settings |
collection_metadata | Optional[Dict] | Default: NoneCollection configurations. Defaults to None. |