Custom Component do not display
liujichengs opened this issue · comments
liujichengs commented
I have defined why only one Document component is displayed on the UI page, as if there is mutual overlap between the two components. For example, when I delete one component, the other one is displayed
the code is:
A、BookLoaderComponent
class BookLoaderComponent(CustomComponent):
display_name: str = "BookLoader"
description: str = ""
def build_config(self) -> Dict[str, Any]:
return {
"token": {
"display_name": "Token",
"required": "true",
},
"code": {"show": "true"},
}
def build(
self,
token: str,
team_code: str,
knowledge_code: str
) -> List[Document]:
docs = collect(token)
metadata = {"title": "title", "source": ""}
return [Document(page_content=docs, metadata=metadata)]
B、DocComponent
class DocComponent(CustomComponent):
display_name: str = "DocLoader"
description: str = ""
def build_config(self) -> Dict[str, Any]:
return {
"token": {
"display_name": "Token",
"required": "true",
},
"team_code": {
"display_name": "TeamCode",
"required": "true",
},
"code": {"show": "true"},
}
def build(
self,
token: str,
team_code: str,
) -> List[Document]:
docs = get_doc_detail_by_code(team_code, token)
metadata = {"title": "ue", "source": ""}
return [Document(page_content=docs, metadata=metadata)]
Both files are in the documentloaders folder
my langflow version is v0.6.10
help
Gabriel Luiz Freitas Almeida commented
Hey @liujichengs
Both components work on the frontend?
This might be a bug in the main, version.
I'll take a look at this later today. Thanks for the report!