File size: 709 Bytes
f51bb92
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
from .helpers import VectorStoreRetrieverScore
from .base import BaseRetriever


class FaissRetriever(BaseRetriever):
    def __init__(self):
        pass

    def return_retriever(self, db, config):
        retriever = VectorStoreRetrieverScore(
            vectorstore=db,
            # search_type="similarity_score_threshold",
            # search_kwargs={
            #     "score_threshold": self.config["vectorstore"][
            #         "score_threshold"
            #     ],
            #     "k": self.config["vectorstore"]["search_top_k"],
            # },
            search_kwargs={
                "k": config["vectorstore"]["search_top_k"],
            },
        )
        return retriever