Rework Chat Assistant Settings

This commit is contained in:
Petr Mironychev
2024-11-10 22:13:33 +01:00
parent 2acaef553d
commit 85d039cbd5
14 changed files with 412 additions and 114 deletions

View File

@ -22,7 +22,7 @@
#include <QtQml>
#include <utils/aspects.h>
#include "GeneralSettings.hpp"
#include "ChatAssistantSettings.hpp"
namespace QodeAssist::Chat {
@ -30,12 +30,12 @@ ChatModel::ChatModel(QObject *parent)
: QAbstractListModel(parent)
, m_totalTokens(0)
{
// auto &settings = Settings::generalSettings();
auto &settings = Settings::chatAssistantSettings();
// connect(&settings.chatTokensThreshold,
// &Utils::BaseAspect::changed,
// this,
// &ChatModel::tokensThresholdChanged);
connect(&settings.chatTokensThreshold,
&Utils::BaseAspect::changed,
this,
&ChatModel::tokensThresholdChanged);
}
int ChatModel::rowCount(const QModelIndex &parent) const
@ -183,9 +183,8 @@ int ChatModel::totalTokens() const
int ChatModel::tokensThreshold() const
{
// auto &settings = Settings::generalSettings();
// return settings.chatTokensThreshold();
return 0;
auto &settings = Settings::chatAssistantSettings();
return settings.chatTokensThreshold();
}
QString ChatModel::lastMessageId() const