throwIfCancelled method

void throwIfCancelled()

Throws AiToolCallCancelled if isCancelled. Call between steps of a long tool to bail out promptly.

Implementation

void throwIfCancelled() {
  if (_cancelled) throw const AiToolCallCancelled();
}