diff --git a/libs/langchain/langchain/vectorstores/faiss.py b/libs/langchain/langchain/vectorstores/faiss.py index 0e29daf01b..a5f1ba4b61 100644 --- a/libs/langchain/langchain/vectorstores/faiss.py +++ b/libs/langchain/langchain/vectorstores/faiss.py @@ -727,7 +727,6 @@ class FAISS(VectorStore): """Return docs and their similarity scores on a scale from 0 to 1.""" # Pop score threshold so that only relevancy scores, not raw scores, are # filtered. - score_threshold = kwargs.pop("score_threshold", None) relevance_score_fn = self._select_relevance_score_fn() if relevance_score_fn is None: raise ValueError( @@ -744,10 +743,4 @@ class FAISS(VectorStore): docs_and_rel_scores = [ (doc, relevance_score_fn(score)) for doc, score in docs_and_scores ] - if score_threshold is not None: - docs_and_rel_scores = [ - (doc, similarity) - for doc, similarity in docs_and_rel_scores - if similarity >= score_threshold - ] return docs_and_rel_scores