You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix: Limit number of retries for parse failures (#1569)
When parsing of an LLM response fails, the invalid output is sent to the
LLM to be fixed.
This PR threads the number of retries through this call, preventing
unbounded recursion.
The old `max_retries` wasn't preventing this due to `generate()` and
`parse_output_string()` being co-recursive via the call to `generate()`
here
https://github.com/explodinggradients/ragas/blob/ade46fb7c0b5dffb76ef26d876ff021ded9dfa96/src/ragas/prompt/pydantic_prompt.py#L406
The result was a prompt that would keep growing through recursive calls
(with nested versions becoming increasingly more deeply quoted) until
the prompt was too big for the LLM to process.
Addresses #1538
0 commit comments