Return the Vector Store initialized from texts and embeddings.
from_texts(
cls: Type[VST],
texts: List[str],
embedding: Embeddings,
metadatas: Optional[List[dict]] = None,
**kwargs: Any = {}
) -> VST| Name | Type | Description |
|---|---|---|
cls* | Type[VST] | The Vector Store class to use to initialize the Vector Store. |
texts* | List[str] | The texts to initialize the Vector Store with. |
embedding* | Embeddings | The embedding function to use. |
metadatas | Optional[List[dict]] | Default: NoneThe metadata associated with the texts. Defaults to None. |
kwargs | Any | Default: {}Vector Store specific parameters. The following are forwarded to the Vector Store constructor and required: |
- index_name* | str | The name of the index to store the documents in. Defaults to "default". |
- text_field* | str | The name of the metadata field to store the original text in. Defaults to "text". |
- distance_strategy* | DistanceStrategy | The distance strategy to use. Defaults to DistanceStrategy.COSINE. If you select DistanceStrategy.EUCLIDEAN_DISTANCE, Momento uses the squared Euclidean distance. |
- ensure_index_exists* | bool | Whether to ensure that the index exists before adding documents to it. Defaults to True. |
- client* | PreviewVectorIndexClient | The Momento Vector Index client to use. |
- api_key* | Optional[str] | The configuration to use to initialize
the Vector Index with. Defaults to None. If None, the configuration
is initialized from the environment variable |