mirror of
https://github.com/Palm1r/QodeAssist.git
synced 2025-07-21 22:44:59 -04:00
feat: add chunking
This commit is contained in:
@ -39,6 +39,7 @@
|
||||
#include "Logger.hpp"
|
||||
#include "ProjectSettings.hpp"
|
||||
#include "context/ContextManager.hpp"
|
||||
#include "context/FileChunker.hpp"
|
||||
#include "context/RAGManager.hpp"
|
||||
#include "context/TokenUtils.hpp"
|
||||
|
||||
@ -484,6 +485,18 @@ void ChatRootView::testRAG(const QString &message)
|
||||
});
|
||||
}
|
||||
|
||||
void ChatRootView::testChunking()
|
||||
{
|
||||
auto project = ProjectExplorer::ProjectTree::currentProject();
|
||||
if (!project) {
|
||||
qDebug() << "No active project found";
|
||||
return;
|
||||
}
|
||||
|
||||
Context::FileChunker::ChunkingConfig config;
|
||||
Context::ContextManager::instance().testProjectChunks(project, config);
|
||||
}
|
||||
|
||||
void ChatRootView::updateInputTokensCount()
|
||||
{
|
||||
int inputTokens = m_messageTokensCount;
|
||||
|
@ -66,6 +66,7 @@ public:
|
||||
Q_INVOKABLE void setIsSyncOpenFiles(bool state);
|
||||
Q_INVOKABLE void openChatHistoryFolder();
|
||||
Q_INVOKABLE void testRAG(const QString &message);
|
||||
Q_INVOKABLE void testChunking();
|
||||
|
||||
Q_INVOKABLE void updateInputTokensCount();
|
||||
int inputTokensCount() const;
|
||||
|
@ -199,6 +199,7 @@ ChatRootView {
|
||||
attachFiles.onClicked: root.showAttachFilesDialog()
|
||||
linkFiles.onClicked: root.showLinkFilesDialog()
|
||||
testRag.onClicked: root.testRAG(messageInput.text)
|
||||
testChunks.onClicked: root.testChunking()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -31,6 +31,7 @@ Rectangle {
|
||||
property alias attachFiles: attachFilesId
|
||||
property alias linkFiles: linkFilesId
|
||||
property alias testRag: testRagId
|
||||
property alias testChunks: testChunksId
|
||||
|
||||
color: palette.window.hslLightness > 0.5 ?
|
||||
Qt.darker(palette.window, 1.1) :
|
||||
@ -98,6 +99,12 @@ Rectangle {
|
||||
text: qsTr("Test RAG")
|
||||
}
|
||||
|
||||
QoAButton {
|
||||
id: testChunksId
|
||||
|
||||
text: qsTr("Test Chunks")
|
||||
}
|
||||
|
||||
Item {
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
|
Reference in New Issue
Block a user