🔨 refactor(base.py): make function_name and initialize methods abstract

This commit makes the `function_name` and `initialize` methods abstract in the `CustomChain` and `CustomAgentExecutor` classes. This is done to enforce the implementation of these methods in the subclasses of these classes. This change improves the code quality and readability by making the code more explicit and easier to understand.
This commit is contained in:
Gabriel Luiz Freitas Almeida 2023-06-08 00:14:33 -03:00
commit 85d2f9cce8

View file

@ -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