| Name | Type | Description |
|---|---|---|
text_embeddings* | List[Tuple[str, List[float]]] | List of tuples of text and embeddings. |
embedding* | Embeddings | Embeddings object. |
metadatas | Optional[List[dict]] | Default: None |
collection_name | str | Default: _LANGCHAIN_DEFAULT_COLLECTION_NAME |
distance_strategy | DistanceStrategy | Default: DEFAULT_DISTANCE_STRATEGY |
ids | Optional[List[str]] | Default: None |
pre_delete_collection | bool | Default: False |
kwargs | Any | Default: {} |
Construct PGVector wrapper from raw documents and embeddings.
Example:
.. code-block:: python
from langchain_postgres.vectorstores import PGVector from langchain_openai.embeddings import OpenAIEmbeddings
embeddings = OpenAIEmbeddings() text_embeddings = embeddings.embed_documents(texts) text_embedding_pairs = list(zip(texts, text_embeddings)) vectorstore = PGVector.from_embeddings(text_embedding_pairs, embeddings)
Optional list of metadatas associated with the texts.
Name of the collection.
Distance strategy to use.
Optional list of ids for the documents. If not provided, will generate a new id for each document.
If True, will delete the collection if it exists. Attention: This will delete all the documents in the existing collection.
Additional arguments.