From 85d2f9cce8bda98a747898e50adc0f726dd54fc7 Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Thu, 8 Jun 2023 00:14:33 -0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A8=20refactor(base.py):=20make=20func?= =?UTF-8?q?tion=5Fname=20and=20initialize=20methods=20abstract=20This=20co?= =?UTF-8?q?mmit=20makes=20the=20`function=5Fname`=20and=20`initialize`=20m?= =?UTF-8?q?ethods=20abstract=20in=20the=20`CustomChain`=20and=20`CustomAge?= =?UTF-8?q?ntExecutor`=20classes.=20This=20is=20done=20to=20enforce=20the?= =?UTF-8?q?=20implementation=20of=20these=20methods=20in=20the=20subclasse?= =?UTF-8?q?s=20of=20these=20classes.=20This=20change=20improves=20the=20co?= =?UTF-8?q?de=20quality=20and=20readability=20by=20making=20the=20code=20m?= =?UTF-8?q?ore=20explicit=20and=20easier=20to=20understand.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/backend/langflow/interface/base.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/backend/langflow/interface/base.py b/src/backend/langflow/interface/base.py index 3670bb8ae..fa7b39650 100644 --- a/src/backend/langflow/interface/base.py +++ b/src/backend/langflow/interface/base.py @@ -91,10 +91,12 @@ class CustomChain(Chain, ABC): """Custom chain""" @staticmethod + @abstractmethod def function_name(): return "CustomChain" @classmethod + @abstractmethod def initialize(cls, *args, **kwargs): pass @@ -109,10 +111,12 @@ class CustomAgentExecutor(AgentExecutor, ABC): """Custom chain""" @staticmethod + @abstractmethod def function_name(): return "CustomChain" @classmethod + @abstractmethod def initialize(cls, *args, **kwargs): pass