working full

This commit is contained in:
Alex
2023-09-27 16:25:57 +01:00
parent 025549ebf8
commit 8fa9657ba6
10 changed files with 175 additions and 157 deletions

View 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)