From 2fc24bc94915692dd854e27d9fda9a22b24edfda Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Mon, 28 Oct 2024 09:12:38 -0400 Subject: [PATCH] Update simplemind/chains/base.py Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- simplemind/chains/base.py | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/simplemind/chains/base.py b/simplemind/chains/base.py index 279fdf5..41013c7 100644 --- a/simplemind/chains/base.py +++ b/simplemind/chains/base.py @@ -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