Add llm parameter to build method in VectorStoreRouterToolkitComponent
This commit is contained in:
parent
c05ab078fa
commit
00d80a4b9b
1 changed files with 5 additions and 6 deletions
|
|
@ -3,6 +3,7 @@ from langflow import CustomComponent
|
||||||
from typing import List
|
from typing import List
|
||||||
from langchain.agents.agent_toolkits.vectorstore.toolkit import VectorStoreRouterToolkit
|
from langchain.agents.agent_toolkits.vectorstore.toolkit import VectorStoreRouterToolkit
|
||||||
from langchain.agents.agent_toolkits.vectorstore.toolkit import VectorStoreInfo
|
from langchain.agents.agent_toolkits.vectorstore.toolkit import VectorStoreInfo
|
||||||
|
from langflow.field_typing import BaseLanguageModel,Tool
|
||||||
|
|
||||||
class VectorStoreRouterToolkitComponent(CustomComponent):
|
class VectorStoreRouterToolkitComponent(CustomComponent):
|
||||||
display_name = "VectorStoreRouterToolkit"
|
display_name = "VectorStoreRouterToolkit"
|
||||||
|
|
@ -11,14 +12,12 @@ class VectorStoreRouterToolkitComponent(CustomComponent):
|
||||||
def build_config(self):
|
def build_config(self):
|
||||||
return {
|
return {
|
||||||
"vectorstores": {"display_name": "Vector Stores"},
|
"vectorstores": {"display_name": "Vector Stores"},
|
||||||
|
"llm": {"display_name": "LLM"},
|
||||||
}
|
}
|
||||||
|
|
||||||
def build(
|
def build(
|
||||||
self,
|
self,
|
||||||
vectorstores: List[VectorStoreInfo],
|
vectorstores: List[VectorStoreInfo],
|
||||||
):
|
llm: BaseLanguageModel
|
||||||
# Assuming the class `VectorStoreRouterToolkit` exists within a module, but since there
|
)->Tool:
|
||||||
# is no further information provided about the module structure, I will assume it is
|
return VectorStoreRouterToolkit(vectorstores=vectorstores,llm=llm)
|
||||||
# accessible from the current context. If it's in `langchain.vectorstores`, it should be
|
|
||||||
# imported from there.
|
|
||||||
return VectorStoreRouterToolkit(vectorstores=vectorstores)
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue