Execution mode that runs a single step at a time.
A "step" is: execute any pending tool calls, then call the LLM. If no tools were pending, just call the LLM.
Options
:should_continue?— Function(LLMChain.t() -> boolean())called after each step. If it returnstrue, another step runs. Iffalseor not provided, the mode returns after one step.
Usage
# Single step
LLMChain.run(chain, mode: :step)
# Auto-loop with condition
LLMChain.run(chain, mode: :step,
should_continue?: fn chain ->
chain.needs_response && length(chain.exchanged_messages) < 10
end)