From a0377c0ac71190ccca6663f6e68bedb0dea38758 Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Mon, 11 Dec 2023 12:32:02 -0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix(custom=5Fcomponent.py):=20re?= =?UTF-8?q?name=20build=5Ftemplate=5Fconfig=20method=20to=20template=5Fcon?= =?UTF-8?q?fig=20for=20better=20naming=20consistency=20=F0=9F=94=A7=20chor?= =?UTF-8?q?e(test=5Fcustom=5Fcomponent.py):=20update=20test=5Fcustom=5Fcom?= =?UTF-8?q?ponent=5Fbuild=5Ftemplate=5Fconfig=20to=20use=20the=20renamed?= =?UTF-8?q?=20template=5Fconfig=20property?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/backend/langflow/interface/custom/custom_component.py | 3 +++ tests/test_custom_component.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/backend/langflow/interface/custom/custom_component.py b/src/backend/langflow/interface/custom/custom_component.py index 4ff58fd27..c2a7c4c74 100644 --- a/src/backend/langflow/interface/custom/custom_component.py +++ b/src/backend/langflow/interface/custom/custom_component.py @@ -165,6 +165,9 @@ class CustomComponent(Component): return next(iter(classes), "") @property + def template_config(self): + return self.build_template_config() + def build_template_config(self): if not self.code: return {} diff --git a/tests/test_custom_component.py b/tests/test_custom_component.py index 007374763..35eaba00e 100644 --- a/tests/test_custom_component.py +++ b/tests/test_custom_component.py @@ -120,7 +120,7 @@ def test_custom_component_build_template_config(): Test the build_template_config property of the CustomComponent class. """ custom_component = CustomComponent(code=code_default, function_entrypoint_name="build") - config = custom_component.build_template_config + config = custom_component.template_config assert isinstance(config, dict)