Refactor BasePlugin class to remove ABC inheritance and abstract method decorators

This commit is contained in:
2024-10-30 18:02:03 -04:00
parent 2309c30b8f
commit e9e47e27a1
+1 -6
View File
@@ -22,33 +22,28 @@ class SMBaseModel(BaseModel):
return str(self)
class BasePlugin(ABC):
class BasePlugin:
"""The base conversation plugin class."""
# Plugin metadata.
meta: Dict[str, Any] = {}
# @abstractmethod
def initialize_hook(self, conversation: "Conversation"):
"""Initialize a hook for the plugin."""
raise NotImplementedError
# @abstractmethod
def cleanup_hook(self, conversation: "Conversation"):
"""Cleanup a hook for the plugin."""
raise NotImplementedError
# @abstractmethod
def add_message_hook(self, conversation: "Conversation", message: "Message"):
"""Add a message hook for the plugin."""
raise NotImplementedError
# @abstractmethod
def pre_send_hook(self, conversation: "Conversation"):
"""Pre-send hook for the plugin."""
raise NotImplementedError
# @abstractmethod
def post_send_hook(self, conversation: "Conversation", response: "Message"):
"""Post-send hook for the plugin."""
raise NotImplementedError