Initialize Lantern vectorstore from list of texts.
The embeddings will be generated using embedding class provided.
Order of elements for lists ids, texts, metadatas should match,
so each row will be associated with correct values.
Postgres connection string is required
"Either pass it as connection_string parameter
or set the LANTERN_CONNECTION_STRING environment variable.
connection_string is fully populated connection string for postgres databasetexts texts to insert into collection.embedding is :class:Embeddings that will be used for
embedding the text sent. If none is sent, then the
multilingual Tensorflow Universal Sentence Encoder will be used.metadatas row metadata to insert into collection.collection_name is the name of the collection to use. (default: langchain)
distance_strategy is the distance strategy to use. (default: EUCLIDEAN)
EUCLIDEAN is the euclidean distance.COSINE is the cosine distance.HAMMING is the hamming distance.ids row ids to insert into collection.pre_delete_collection if True, will delete the collection if it exists.
(default: False)
from_texts(
cls: Type[Lantern],
texts: List[str],
embedding: Embeddings,
metadatas: Optional[List[dict]] = None,
collection_name: str = _LANGCHAIN_DEFAULT_COLLECTION_NAME,
distance_strategy: DistanceStrategy = DEFAULT_DISTANCE_STRATEGY,
ids: Optional[List[str]] = None,
pre_delete_collection: bool = False,
**kwargs: Any = {}
) -> Lantern