AbortPolicy

fun interface AbortPolicy

A condition that may abort an execution based on the running cumulative LLM consumption.

Implementations are injected into a training session / evaluation run and consulted from a hook that sees the running cumulative — typically the root scope's onUpdate. They abort via a shared AbortController, which guarantees at most one ExecutionAbortException escapes.

Functions

Link copied to clipboard
abstract fun checkAndAbortIfExceeded(cumulative: LLMConsumption?)

Inspect the running cumulative consumption and abort if this policy's condition is met.