MCPcopy Create free account
hub / github.com/Codeya-IDE/deepin-ide / updateModelCb

Method updateModelCb

src/plugins/chat/widgets/askpagewidget.cpp:340–358  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

338}
339
340void AskPageWidget::updateModelCb()
341{
342 using namespace dpfservice;
343 auto aiSrv = dpfGetService(AiService);
344 auto allLLMs = aiSrv->getAllModel();
345
346 auto selectedLLMVariant = OptionManager::getInstance()->getValue(optionCategory, selectedLLM);
347 auto userSelectedLLMInfo = LLMInfo::fromVariantMap(selectedLLMVariant.toMap());
348
349 modelCb->clear();
350 for (auto llm : allLLMs)
351 modelCb->addItem(llm.icon, llm.modelName, llm.toVariant());
352
353 if (!userSelectedLLMInfo.modelName.isEmpty())
354 modelCb->setCurrentText(userSelectedLLMInfo.modelName);
355
356 if (!modelCb->currentText().isEmpty())
357 ChatManager::instance()->onLLMChanged(LLMInfo::fromVariantMap(modelCb->currentData().toMap()));
358}
359
360void AskPageWidget::onStopGenerate()
361{

Callers

nothing calls this directly

Calls 7

getAllModelMethod · 0.80
toVariantMethod · 0.80
getValueMethod · 0.45
clearMethod · 0.45
addItemMethod · 0.45
isEmptyMethod · 0.45
onLLMChangedMethod · 0.45

Tested by

no test coverage detected