| 558 | } |
| 559 | |
| 560 | void ChatManager::installConda() |
| 561 | { |
| 562 | if (installCondaTimer.isActive()) |
| 563 | return; |
| 564 | |
| 565 | QString scriptPath = CustomPaths::CustomPaths::global(CustomPaths::Scripts) + "/rag/install.sh"; |
| 566 | QProcess process; |
| 567 | process.setProgram("ps"); |
| 568 | process.setArguments({ "aux" }); |
| 569 | process.start(); |
| 570 | process.waitForFinished(); |
| 571 | QString output = process.readAll(); |
| 572 | |
| 573 | // check install script is running |
| 574 | bool exists = output.contains(scriptPath); |
| 575 | if (exists) |
| 576 | return; |
| 577 | auto terminalServ = dpfGetService(dpfservice::TerminalService); |
| 578 | WindowService *windowService = dpfGetService(WindowService); |
| 579 | windowService->switchContextWidget(dpfservice::TERMINAL_TAB_TEXT); |
| 580 | terminalServ->executeCommand("install", "bash", QStringList() << scriptPath << condaRootPath(), condaRootPath(), QStringList()); |
| 581 | |
| 582 | installCondaTimer.setSingleShot(true); // terminal may not execute it immediately. add timer to Prevent multiple triggers within a short period of time. |
| 583 | installCondaTimer.start(2000); |
| 584 | } |
| 585 | |
| 586 | void ChatManager::generateRag(const QString &projectPath) |
| 587 | { |
no test coverage detected