mirror of
https://github.com/hwchase17/langchain.git
synced 2025-06-23 15:19:33 +00:00
community[patch]: Replace function in CassandraVectorStore with simpler lambda (#20323)
This commit is contained in:
parent
75733c5cc1
commit
a22da4315b
@ -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…
Reference in New Issue
Block a user