From 00d80a4b9b3429c84c68a22a278db85a45797d28 Mon Sep 17 00:00:00 2001 From: anovazzi1 Date: Tue, 16 Jan 2024 17:33:39 -0300 Subject: [PATCH] Add llm parameter to build method in VectorStoreRouterToolkitComponent --- .../components/toolkits/VectorStoreRouterToolkit.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/backend/langflow/components/toolkits/VectorStoreRouterToolkit.py b/src/backend/langflow/components/toolkits/VectorStoreRouterToolkit.py index 11ff2a6cc..7264f1328 100644 --- a/src/backend/langflow/components/toolkits/VectorStoreRouterToolkit.py +++ b/src/backend/langflow/components/toolkits/VectorStoreRouterToolkit.py @@ -3,6 +3,7 @@ from langflow import CustomComponent from typing import List from langchain.agents.agent_toolkits.vectorstore.toolkit import VectorStoreRouterToolkit from langchain.agents.agent_toolkits.vectorstore.toolkit import VectorStoreInfo +from langflow.field_typing import BaseLanguageModel,Tool class VectorStoreRouterToolkitComponent(CustomComponent): display_name = "VectorStoreRouterToolkit" @@ -11,14 +12,12 @@ class VectorStoreRouterToolkitComponent(CustomComponent): def build_config(self): return { "vectorstores": {"display_name": "Vector Stores"}, + "llm": {"display_name": "LLM"}, } def build( self, vectorstores: List[VectorStoreInfo], - ): - # Assuming the class `VectorStoreRouterToolkit` exists within a module, but since there - # is no further information provided about the module structure, I will assume it is - # accessible from the current context. If it's in `langchain.vectorstores`, it should be - # imported from there. - return VectorStoreRouterToolkit(vectorstores=vectorstores) + llm: BaseLanguageModel + )->Tool: + return VectorStoreRouterToolkit(vectorstores=vectorstores,llm=llm)