Return docs most similar to query.
delete(ids: Optional[List[str]] = None, **kwargs: Any) → None[source]¶
Delete by vector IDs.
Parameters
ids – List of ids to delete.
classmethod from_documents(documents: List[Document], embedding: Embeddings, **kwargs: Any) → VST¶
Return VectorStore initialized from documents and embeddings.
classmethod from_texts(texts: List[str], embedding: Embeddings, metadatas: Optional[List[dict]] = None, *, client: Optional[weaviate.Client] = None, weaviate_url: Optional[str] = None, weaviate_api_key: Optional[str] = None, batch_size: Optional[int] = None, index_name: Optional[str] = None, text_key: str = 'text', by_text: bool = False, relevance_score_fn: Optional[Callable[[float], float]] = <function _default_score_normalizer>, **kwargs: Any) → Weaviate[source]¶
Construct Weaviate wrapper from raw documents.
This is a user-friendly interface that:
Embeds documents.
Creates a new index for the embeddings in the Weaviate instance.
Adds the documents to the newly created Weaviate index.
This is intended to be a quick way to get started.
Parameters
texts – Texts to add to vector store.
embedding – Text embedding model to use.
metadatas – Metadata associated with each text.
client – weaviate.Client to use.
weaviate_url – The Weaviate URL. If using Weaviate Cloud Services get it
from the Details tab. Can be passed in as a named param or by
setting the environment variable WEAVIATE_URL. Should not be
specified if client is provided.
weaviate_api_key – The Weaviate API key. If enabled and using Weaviate Cloud