Execution mode that loops until a successful result.
Calls the LLM, executes tool calls, and repeats until:
- The last message is an assistant response (success)
- The last message is a tool result with no errors (success)
- Max retry count is exceeded (error)
Options
:force_recurse— Whentrue, forces recursion even after a successful result. Used internally byUntilToolUsedmode. Default:false.
Usage
LLMChain.run(chain, mode: :until_success)