MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / setModel

Method setModel

app/src/AI/Assistant.cpp:339–356  ·  view source on GitHub ↗

* @brief Sets and persists the model for the given provider. */

Source from the content-addressed store, hash-verified

337 * @brief Sets and persists the model for the given provider.
338 */
339void 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.

Callers

nothing calls this directly

Calls 2

currentModelMethod · 0.45
setCurrentModelMethod · 0.45

Tested by

no test coverage detected