community[patch]: Replace function in CassandraVectorStore with simpler lambda (#20323)

pull/20424/head^2
Christophe Bornet 1 month ago committed by GitHub
parent 75733c5cc1
commit a22da4315b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -112,18 +112,13 @@ class Cassandra(VectorStore):
def embeddings(self) -> Embeddings:
return self.embedding
@staticmethod
def _dont_flip_the_cos_score(distance: float) -> float:
# the identity
return distance
def _select_relevance_score_fn(self) -> Callable[[float], float]:
"""
The underlying VectorTable already returns a "score proper",
i.e. one in [0, 1] where higher means more *similar*,
so here the final score transformation is not reversing the interval:
"""
return self._dont_flip_the_cos_score
return lambda score: score
def delete_collection(self) -> None:
"""

Loading…
Cancel
Save