From e5e23a1da6e34f4950c601c7ab712fac4cc479e1 Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Wed, 9 Aug 2023 15:32:41 -0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix(component.py):=20add=20suppo?= =?UTF-8?q?rt=20for=20"documentation"=20field=20in=20template=5Fconfig=20t?= =?UTF-8?q?o=20properly=20handle=20component=20documentation=20?= =?UTF-8?q?=F0=9F=90=9B=20fix(types.py):=20update=5Fattributes=20function?= =?UTF-8?q?=20now=20updates=20frontend=5Fnode=20with=20"documentation"=20f?= =?UTF-8?q?ield=20from=20template=5Fconfig?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/backend/langflow/interface/custom/component.py | 3 +++ src/backend/langflow/interface/types.py | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/backend/langflow/interface/custom/component.py b/src/backend/langflow/interface/custom/component.py index d122eb6da..06db5bd46 100644 --- a/src/backend/langflow/interface/custom/component.py +++ b/src/backend/langflow/interface/custom/component.py @@ -66,6 +66,9 @@ class Component(BaseModel): elif "beta" in item_name: template_config["beta"] = ast.literal_eval(item_value) + elif "documentation" in item_name: + template_config["documentation"] = ast.literal_eval(item_value) + return template_config def build(self, *args: Any, **kwargs: Any) -> Any: diff --git a/src/backend/langflow/interface/types.py b/src/backend/langflow/interface/types.py index 950f227b4..885e33694 100644 --- a/src/backend/langflow/interface/types.py +++ b/src/backend/langflow/interface/types.py @@ -199,6 +199,9 @@ def update_attributes(frontend_node, template_config): if "beta" in template_config: frontend_node["beta"] = template_config["beta"] + if "documentation" in template_config: + frontend_node["documentation"] = template_config["documentation"] + def build_field_config(custom_component: CustomComponent): """Build the field configuration for a custom component"""