-
Notifications
You must be signed in to change notification settings - Fork 47
Description
Is your feature request related to a problem? Please describe.
When developers use PDL for AI agent purpose by using ReAct pattern, LLM can make mistakes on function calling and the function code might unexpectedly finishes with an exception. This often happens within a repeat block because it is used as trial loop in ReAct pattern.
If I understand PDL correctly, currently there is no ways to handle such errors, but I believe it would be really useful if this type of features are available.
Describe the solution you'd like
I would like to have a new option of a repeat block retry_on_error, which is a simple boolean attribute indicates whether it should be retried when any errors happen.
By default, this can be set to false and then everything is same as the current implementation. Only when this value is true, the retry feature is enabled.
Also, another attribute like retry_max might be good, which is integer field to specify the maximum number of retrying, to make it customizable.
Additional context
I made a PoC codes in my fork branch and it is ready for making a PR.