Return docs most similar to query.
delete(ids: Optional[List[str]] = None, skip_strict_exist_check: bool = False, **kwargs: Any) → Optional[bool][source]¶
Parameters
skip_strict_exist_check – Deprecated. This is not used basically.
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, host: str = 'localhost', port: int = 8080, grpc_options: Tuple = (('grpc.keepalive_time_ms', 10000), ('grpc.keepalive_timeout_ms', 10000)), skip_strict_exist_check: bool = False, **kwargs: Any) → Vald[source]¶
Parameters
skip_strict_exist_check – Deprecated. This is not used basically.
max_marginal_relevance_search(query: str, k: int = 4, fetch_k: int = 20, lambda_mult: float = 0.5, radius: float = - 1.0, epsilon: float = 0.01, timeout: int = 3000000000, **kwargs: Any) → List[Document][source]¶
Return docs selected using the maximal marginal relevance.
Maximal marginal relevance optimizes for similarity to query AND diversity
among selected documents.
Parameters
query – Text to look up documents similar to.
k – Number of Documents to return. Defaults to 4.
fetch_k – Number of Documents to fetch to pass to MMR algorithm.
lambda_mult – Number between 0 and 1 that determines the degree
of diversity among the results with 0 corresponding
to maximum diversity and 1 to minimum diversity.
Defaults to 0.5.
Returns