| 399 | } |
| 400 | |
| 401 | void ChatManager::initConnections() |
| 402 | { |
| 403 | connect(this, &ChatManager::noChunksFounded, this, &ChatManager::showIndexingWidget); |
| 404 | |
| 405 | connect(Copilot::instance(), &Copilot::messageSended, this, &ChatManager::startReceiving); |
| 406 | |
| 407 | connect(this, &ChatManager::requestStop, Copilot::instance(), &Copilot::requestStop); |
| 408 | connect(this, &ChatManager::notify, this, [](int type, const QString &message, QStringList actions) { |
| 409 | WindowService *windowService = dpfGetService(WindowService); |
| 410 | windowService->notify(type, "Ai", message, actions); |
| 411 | }); |
| 412 | connect(this, &ChatManager::sendSyncRequest, this, &ChatManager::slotSendSyncRequest); |
| 413 | connect(this, &ChatManager::llmChanged, Copilot::instance(), [=](const LLMInfo &info) { |
| 414 | auto aiSrv = dpfGetService(AiService); |
| 415 | auto copilotLLM = aiSrv->getLLM(info); // Use a new LLM to avoid affecting chatLLM |
| 416 | if (copilotLLM) |
| 417 | Copilot::instance()->setCopilotLLM(copilotLLM); |
| 418 | }); |
| 419 | } |
| 420 | |
| 421 | void ChatManager::initLLM(AbstractLLM *llm) |
| 422 | { |
nothing calls this directly
no test coverage detected