mirror of
https://github.com/arc53/DocsGPT.git
synced 2025-11-29 16:43:16 +00:00
working full
This commit is contained in:
15
application/vectorstore/faiss.py
Normal file
15
application/vectorstore/faiss.py
Normal file
@@ -0,0 +1,15 @@
|
||||
from application.vectorstore.base import BaseVectorStore
|
||||
from langchain import FAISS
|
||||
from application.core.settings import settings
|
||||
|
||||
class FaissStore(BaseVectorStore):
|
||||
|
||||
def __init__(self, path, embeddings_key):
|
||||
super().__init__()
|
||||
self.path = path
|
||||
self.docsearch = FAISS.load_local(
|
||||
self.path, self._get_docsearch(settings.EMBEDDINGS_NAME, settings.EMBEDDINGS_KEY)
|
||||
)
|
||||
|
||||
def search(self, *args, **kwargs):
|
||||
return self.docsearch.similarity_search(*args, **kwargs)
|
||||
Reference in New Issue
Block a user