From 4bfaca5f21fe796d96d166f27ff3ada4503f73fd Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Thu, 2 Nov 2023 22:20:57 -0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix(custom=5Fcomponent.py):=20fi?= =?UTF-8?q?x=20syntax=20error=20in=20CustomComponent=20class=20definition?= =?UTF-8?q?=20=E2=9C=A8=20feat(custom=5Fcomponent.py):=20add=20display=5Fn?= =?UTF-8?q?ame=20and=20description=20class=20variables=20to=20CustomCompon?= =?UTF-8?q?ent=20for=20better=20customization=20and=20documentation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/backend/langflow/interface/custom/custom_component.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/backend/langflow/interface/custom/custom_component.py b/src/backend/langflow/interface/custom/custom_component.py index c734543ec..7f7dd588a 100644 --- a/src/backend/langflow/interface/custom/custom_component.py +++ b/src/backend/langflow/interface/custom/custom_component.py @@ -11,11 +11,12 @@ from langflow.utils import validate from langflow.services.database.utils import session_getter from langflow.services.database.models.flow import Flow -from pydantic import Extra import yaml -class CustomComponent(Component, extra=Extra.allow): +class CustomComponent(Component, extra="allow"): + display_name: ClassVar[str] = "Custom Component" + description: ClassVar[str] = "Custom Component" code: Optional[str] = None field_config: dict = {} code_class_base_inheritance: ClassVar[Dict] = "CustomComponent"