Run similarity search with distance.
similarity_search_with_score_by_vector(embedding: List[float], k: int = 4, filter: Optional[Dict[str, str]] = None) → List[Tuple[Document, float]][source]¶
Return docs most similar to embedding vector.
Parameters
embedding (str) – Embedding to look up documents similar to.
k (int) – Number of Documents to return. Defaults to 4.
Returns
List of (Document, score), the most similar to the query vector.
similarity_search_with_score_id(query: str, k: int = 4, filter: Optional[Dict[str, str]] = None) → List[Tuple[Document, float, str]][source]¶
similarity_search_with_score_id_by_vector(embedding: List[float], k: int = 4, filter: Optional[Dict[str, str]] = None) → List[Tuple[Document, float, str]][source]¶
Return docs most similar to embedding vector.
Parameters
embedding (str) – Embedding to look up documents similar to.
k (int) – Number of Documents to return. Defaults to 4.
Returns
List of (Document, score, id), the most similar to the query vector.