From a393ad8e04127998b9acfa8c7346ba93c4b9126e Mon Sep 17 00:00:00 2001 From: Siddhant Rai Date: Fri, 30 May 2025 12:50:11 +0530 Subject: [PATCH] refactor: standardize string quotes and improve retriever type handling in RetrieverCreator --- application/retriever/retriever_creator.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/application/retriever/retriever_creator.py b/application/retriever/retriever_creator.py index 07be373d..26cb41ca 100644 --- a/application/retriever/retriever_creator.py +++ b/application/retriever/retriever_creator.py @@ -3,18 +3,18 @@ from application.retriever.duckduck_search import DuckDuckSearch from application.retriever.brave_search import BraveRetSearch - class RetrieverCreator: retrievers = { - 'classic': ClassicRAG, - 'duckduck_search': DuckDuckSearch, - 'brave_search': BraveRetSearch, - 'default': ClassicRAG + "classic": ClassicRAG, + "duckduck_search": DuckDuckSearch, + "brave_search": BraveRetSearch, + "default": ClassicRAG, } @classmethod def create_retriever(cls, type, *args, **kwargs): - retiever_class = cls.retrievers.get(type.lower()) + retriever_type = (type or "default").lower() + retiever_class = cls.retrievers.get(retriever_type) if not retiever_class: raise ValueError(f"No retievers class found for type {type}") - return retiever_class(*args, **kwargs) \ No newline at end of file + return retiever_class(*args, **kwargs)