Update simplemind/chains/base.py

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
This commit is contained in:
2024-10-28 09:12:38 -04:00
committed by GitHub
parent aaf3f94269
commit 2fc24bc949
+18 -1
View File
@@ -2,6 +2,23 @@ from abc import ABC, abstractmethod
class BaseChain(ABC):
"""Abstract base class for implementing chain operations.
A Chain represents a processing step that can be executed on input data
and should be implemented by concrete classes to define specific behaviors.
"""
@abstractmethod
def run(self, input_data):
def run(self, input_data: str) -> str:
"""Execute the chain's operation on the input data.
Args:
input_data: The input string to be processed by the chain.
Returns:
The processed output string.
Raises:
ValueError: If the input data is invalid or cannot be processed.
"""
pass