changeModel method
Implementation
Future<void> changeModel(DatasetChatModelOption option) async {
if (!canChange || _changeHandler == null || option.key == _activeModel?.key) {
return;
}
_changing = true;
_notifyChanged();
try {
await _changeHandler!(option);
} finally {
_changing = false;
_notifyChanged();
}
}