feat: RAG init

This commit is contained in:
Petr Mironychev
2025-01-26 17:51:01 +01:00
parent 1fa6a225a4
commit 5a426b4d9f
14 changed files with 726 additions and 4 deletions

View File

@ -24,21 +24,23 @@
#include <QFileDialog>
#include <QMessageBox>
#include <coreplugin/editormanager/editormanager.h>
#include <coreplugin/icore.h>
#include <projectexplorer/project.h>
#include <projectexplorer/projectexplorer.h>
#include <projectexplorer/projectmanager.h>
#include <projectexplorer/projecttree.h>
#include <utils/theme/theme.h>
#include <utils/utilsicons.h>
#include <coreplugin/editormanager/editormanager.h>
#include "ChatAssistantSettings.hpp"
#include "ChatSerializer.hpp"
#include "GeneralSettings.hpp"
#include "Logger.hpp"
#include "ProjectSettings.hpp"
#include "context/TokenUtils.hpp"
#include "context/ContextManager.hpp"
#include "context/RAGManager.hpp"
#include "context/TokenUtils.hpp"
namespace QodeAssist::Chat {
@ -447,6 +449,22 @@ void ChatRootView::openChatHistoryFolder()
QDesktopServices::openUrl(url);
}
void ChatRootView::testRAG()
{
auto project = ProjectExplorer::ProjectTree::currentProject();
if (project) {
auto files = Context::ContextManager::instance().getProjectSourceFiles(project);
auto future = Context::RAGManager::instance().processFiles(project, files);
connect(
&Context::RAGManager::instance(),
&Context::RAGManager::vectorizationProgress,
this,
[](int processed, int total) {
qDebug() << "Processed" << processed << "of" << total << "files";
});
}
}
void ChatRootView::updateInputTokensCount()
{
int inputTokens = m_messageTokensCount;