selectModelLocally method
Implementation
void selectModelLocally(DatasetChatModelOption option) {
if (_locked || option.key == _activeModel?.key) {
return;
}
_models = _models.any((model) => model.key == option.key)
? [for (final model in _models) model.copyWith(active: model.key == option.key)]
: [for (final model in _models) model.copyWith(active: false), option.copyWith(active: true)];
_activeModel = option.copyWith(active: true);
_activeModality = _resolvedOutputModality(_activeModel, _activeModality);
_activeVoice = _resolvedVoice(_activeModel, option.defaultOutputVoice);
_notifyChanged();
}