From f26dd89dfad5cc343715a2bb4d07aa3055ea87c7 Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Wed, 19 Jun 2024 20:23:01 -0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20(FAISS.py):=20Remove=20unused=20?= =?UTF-8?q?import=20and=20methods,=20refactor=20class=20name=20to=20improv?= =?UTF-8?q?e=20consistency=20and=20clarity?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../langflow/components/vectorstores/FAISS.py | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/src/backend/base/langflow/components/vectorstores/FAISS.py b/src/backend/base/langflow/components/vectorstores/FAISS.py index 77e098579..dab0a069c 100644 --- a/src/backend/base/langflow/components/vectorstores/FAISS.py +++ b/src/backend/base/langflow/components/vectorstores/FAISS.py @@ -1,17 +1,16 @@ from typing import List from langchain_community.vectorstores import FAISS -from langchain_core.retrievers import BaseRetriever from loguru import logger -from langflow.custom import Component +from langflow.base.vectorstores.model import LCVectorStoreComponent from langflow.field_typing import Text from langflow.helpers.data import docs_to_data from langflow.io import BoolInput, HandleInput, IntInput, Output, StrInput from langflow.schema import Data -class FaissVectorStoreComponent(Component): +class FaissVectorStoreComponent(LCVectorStoreComponent): """ FAISS Vector Store with search capabilities """ @@ -83,18 +82,6 @@ class FaissVectorStoreComponent(Component): ] def build_vector_store(self) -> FAISS: - """ - Builds the Vector Store object. - """ - return self._build_faiss() - - def build_base_retriever(self) -> BaseRetriever: - """ - Builds the BaseRetriever object. - """ - return self._build_faiss() - - def _build_faiss(self) -> FAISS: """ Builds the FAISS object. """