Same as similarity_search_with_relevance_scores but
doesn’t return the scores.
similarity_search_by_vector(embedding: List[float], k: int = 4, distance_func: DistanceFunction = DistanceFunction.COSINE_SIM, where_str: Optional[str] = None, **kwargs: Any) → List[Document][source]¶
Accepts a query_embedding (vector), and returns documents with
similar embeddings.
similarity_search_by_vector_with_relevance_scores(embedding: List[float], k: int = 4, distance_func: DistanceFunction = DistanceFunction.COSINE_SIM, where_str: Optional[str] = None, **kwargs: Any) → List[Tuple[Document, float]][source]¶
Accepts a query_embedding (vector), and returns documents with
similar embeddings along with their relevance scores.
similarity_search_with_relevance_scores(query: str, k: int = 4, distance_func: DistanceFunction = DistanceFunction.COSINE_SIM, where_str: Optional[str] = None, **kwargs: Any) → List[Tuple[Document, float]][source]¶
Perform a similarity search with Rockset
Parameters
query (str) – Text to look up documents similar to.
distance_func (DistanceFunction) – how to compute distance between two
vectors in Rockset.
k (int, optional) – Top K neighbors to retrieve. Defaults to 4.
where_str (Optional[str], optional) – Metadata filters supplied as a
SQL where condition string. Defaults to None.
eg. “price<=70.0 AND brand=’Nintendo’”
NOTE – Please do not let end-user to fill this and always be aware
of SQL injection.
Returns
List of documents with their relevance score
Return type
List[Tuple[Document, float]]