Open b0xtch opened 1 year ago
Maybe we can add hooks to a Step
so that the user can react to the input and output for theStep
. I am thinking about adding the before
and after
hooks. In the before
hook the user can get the input and in the after
hook the user can get the output from the Step
. The executor will run those hooks on execution. This will make Chain
more flexible & observable & easy to debug. It also makes it possible to modify the intermediate values based on their needs.
If we agree on this, I can start working on it.
Maybe we can add hooks to a
Step
so that the user can react to the input and output for theStep
. I am thinking about adding thebefore
andafter
hooks. In thebefore
hook the user can get the input and in theafter
hook the user can get the output from theStep
. The executor will run those hooks on execution. This will makeChain
more flexible & observable & easy to debug. It also makes it possible to modify the intermediate values based on their needs.If we agree on this, I can start working on it.
Sounds like a great plan. Hooks is a great way to solve it. Being able to observe and use step_n is very helpful as it prevents having to run a completely different step to get that result, costing more.
Having the ability to access the result of intermediary results, for example in a sequential chain having the ability to access
{{text}}
.Maybe its possible and I am missing something, feel free to close if that's the case.