API Reference
maxSteps
function maxSteps(n): StopCondition;Defined in: stop/conditions.ts:28
Build a condition that stops once step reaches n turns.
Parameters
| Parameter | Type | Description |
|---|---|---|
n | number | The turn count at which to stop (uses the 1-based ctx.step). |
Returns
A StopCondition that fires when ctx.step >= n.
Example
// Stop after at most 5 model turns.
const stop = maxSteps(5);