Open Agent Loops
API Reference

StopCondition

@open-agent-loops/core


type StopCondition = (ctx) => boolean | Promise<boolean>;

Defined in: stop/conditions.types.ts:45

A predicate that decides whether the loop should stop after the current turn.

Parameters

ParameterTypeDescription
ctxStopContextThe per-turn snapshot of loop state.

Returns

boolean | Promise<boolean>

true to stop the loop, false to continue.

Remarks

Returns (or resolves to) true to stop, false to continue. Conditions may be sync or async. Compose them with the any, all, and not combinators.

See

StopContext

On this page