* @brief Sets and persists the model for the given provider. */
| 337 | * @brief Sets and persists the model for the given provider. |
| 338 | */ |
| 339 | void AI::Assistant::setModel(int providerIdx, const QString& model) |
| 340 | { |
| 341 | auto* p = providerAt(providerIdx); |
| 342 | if (!p) |
| 343 | return; |
| 344 | |
| 345 | if (p->currentModel() == model) |
| 346 | return; |
| 347 | |
| 348 | p->setCurrentModel(model); |
| 349 | |
| 350 | m_settings.beginGroup(QStringLiteral("ai/model")); |
| 351 | m_settings.setValue(modelSettingsKey(providerIdx), p->currentModel()); |
| 352 | m_settings.endGroup(); |
| 353 | |
| 354 | qCDebug(serialStudioAI) << "Model changed for provider" << providerIdx << "to" |
| 355 | << p->currentModel(); |
| 356 | } |
| 357 | |
| 358 | /** |
| 359 | * @brief Updates the cache-stats properties from a Reply. |
nothing calls this directly
no test coverage detected