| 338 | } |
| 339 | |
| 340 | void 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 | |
| 360 | void AskPageWidget::onStopGenerate() |
| 361 | { |
nothing calls this directly
no test coverage detected