Create a VectorStore from a list of texts.
from_texts(
cls,
texts: List[str],
embedding: Embeddings,
metadatas: Optional[List[dict]] = None,
**kwargs: Any = {}
) -> TiDBVectorStore| Name | Type | Description |
|---|---|---|
texts* | List[str] | The list of texts to be added to the TiDB Vector. |
embedding* | Embeddings | The function to use for generating embeddings. |
metadatas | Optional[List[dict]] | Default: NoneThe list of metadata dictionaries corresponding to each text, defaults to None. |
**kwargs | Any | Default: {}Additional keyword arguments. connection_string (str): The connection string for the TiDB database, format: "mysql+pymysql://root@34.212.137.91:4000/test". table_name (str, optional): The name of table used to store vector data, defaults to "langchain_vector". distance_strategy: The distance strategy used for similarity search, defaults to "cosine", allowed: "l2", "cosine". ids (Optional[List[str]]): The list of IDs corresponding to each text, defaults to None. engine_args: Additional arguments for the underlying database engine, defaults to None. drop_existing_table: Drop the existing TiDB table before initializing, defaults to False. |