cancelGeneration method
Marks every live turn stopped and stops the one streaming, if it was sent. With nothing in flight the runtime is not asked: a cancel there changes nothing (0.18.0 and 0.19.0, measured).
Implementation
@override
void cancelGeneration() {
for (final turn in _liveTurns) {
turn.stopAsked = true;
}
if (_streaming case final turn? when turn.sent) {
_stopJs(turn, 'it was stopped');
}
}