Create a Chroma vectorstore from a raw documents.
If a persist_directory is specified, the collection will be persisted there. Otherwise, the data will be ephemeral in-memory.
from_texts(
cls: type[Chroma],
texts: list[str],
embedding: Embeddings | None = None,
metadatas: list[dict] | None = None,
ids: list[str] | None = None,
collection_name: str = _LANGCHAIN_DEFAULT_COLLECTION_NAME,
persist_directory: str | None = None,
host: str | None = None,
port: int | None = None,
headers: dict[str, str] | None = None,
chroma_cloud_api_key: str | None = None,
tenant: str | None = None,
database: str | None = None,
client_settings: chromadb.config.Settings | None = None,
client: chromadb.ClientAPI | None = None,
collection_metadata: dict | None = None,
collection_configuration: CreateCollectionConfiguration | None = None,
*,
ssl: bool = False,
**kwargs: Any = {}
) -> Chroma| Name | Type | Description |
|---|---|---|
texts* | list[str] | List of texts to add to the collection. |
collection_name | str | Default: _LANGCHAIN_DEFAULT_COLLECTION_NAMEName of the collection to create. |
persist_directory | str | None | Default: NoneDirectory to persist the collection. |
host | str | None | Default: NoneHostname of a deployed Chroma server. |
port | int | None | Default: NoneConnection port for a deployed Chroma server. Default is 8000. |
ssl | bool | Default: FalseWhether to establish an SSL connection with a deployed Chroma server. Default is False. |
headers | dict[str, str] | None | Default: NoneHTTP headers to send to a deployed Chroma server. |
chroma_cloud_api_key | str | None | Default: NoneChroma Cloud API key. |
tenant | str | None | Default: NoneTenant ID. Required for Chroma Cloud connections. Default is 'default_tenant' for local Chroma servers. |
database | str | None | Default: NoneDatabase name. Required for Chroma Cloud connections. Default is 'default_database'. |
embedding | Embeddings | None | Default: NoneEmbedding function. |
metadatas | list[dict] | None | Default: NoneList of metadatas. |
ids | list[str] | None | Default: NoneList of document IDs. |
client_settings | chromadb.config.Settings | None | Default: NoneChroma client settings. |
client | chromadb.ClientAPI | None | Default: NoneChroma client. Documentation: https://docs.trychroma.com/reference/python/client |
collection_metadata | dict | None | Default: NoneCollection configurations. |
collection_configuration | CreateCollectionConfiguration | None | Default: NoneIndex configuration for the collection. |
kwargs | Any | Default: {}Additional keyword arguments to initialize a Chroma client. |