🔀 refactor(base.py): add from_method_nodes dictionary to RetrieverCreator class

The `from_method_nodes` dictionary is added to the `RetrieverCreator` class in order to map the "MultiQueryRetriever" node to the "from_llm" method. This refactor improves the readability and maintainability of the code by explicitly defining the mapping between nodes and methods.
This commit is contained in:
Gabriel Luiz Freitas Almeida 2023-06-29 11:18:11 -03:00
commit 8cc0497120

View file

@ -13,6 +13,8 @@ from langflow.utils.util import build_template_from_method
class RetrieverCreator(LangChainTypeCreator):
type_name: str = "retrievers"
from_method_nodes = {"MultiQueryRetriever": "from_llm"}
@property
def frontend_node_class(self) -> Type[RetrieverFrontendNode]:
return RetrieverFrontendNode