griptape
griptape copied to clipboard
Add `RunnableMixin` for pre/post processing on arbitrary run execution
- [x] I have read and agree to the contributing guidelines.
Is your feature request related to a problem? Please describe. there is a lot of different areas of the framework that could benefit from pre/post processing hooks on data.
Describe the solution you'd like
implement a RunnableMixin
:
class RunnableMixin:
process_before_run_fn: Callable[[Any], Any]
process_after_run_fn: Callable[[Any], Any]
def before_run(self, *args, **kwargs) -> None (or Any?): ....
def run(self, *args, **kwargs) -> Any: ...
def after_run(self, *args, **kwargs) -> None (or Any?): ...
Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.
Additional context Add any other context or screenshots about the feature request here.