Create a Zilliz collection, indexes it with HNSW, and insert data.
from_texts(
cls,
texts: List[str],
embedding: Embeddings,
metadatas: Optional[List[dict]] = None,
collection_name: str = 'LangChainCollection',
connection_args: Optional[Dict[str, Any]] = None,
consistency_level: str = 'Session',
index_params: Optional[dict] = None,
search_params: Optional[dict] = None,
drop_old: bool = False,
*,
ids: Optional[List[str]] = None,
auto_id: bool = False,
**kwargs: Any = {}
) -> Zilliz| Name | Type | Description |
|---|---|---|
texts* | List[str] | Text data. |
embedding* | Embeddings | Embedding function. |
metadatas | Optional[List[dict]] | Default: NoneMetadata for each text if it exists. Defaults to None. |
collection_name | str | Default: 'LangChainCollection'Collection name to use. Defaults to "LangChainCollection". |
connection_args | dict[str, Any] | Default: NoneConnection args to use. Defaults to DEFAULT_MILVUS_CONNECTION. |
consistency_level | str | Default: 'Session'Which consistency level to use. Defaults to "Session". |
index_params | Optional[dict] | Default: NoneWhich index_params to use. Defaults to None. |
search_params | Optional[dict] | Default: NoneWhich search params to use. Defaults to None. |
drop_old | Optional[bool] | Default: FalseWhether to drop the collection with that name if it exists. Defaults to False. |
ids | Optional[List[str]] | Default: NoneList of text ids. |
auto_id | bool | Default: FalseWhether to enable auto id for primary key. Defaults to False. If False, you needs to provide text ids (string less than 65535 bytes). If True, Milvus will generate unique integers as primary keys. |