mirror of
https://github.com/Palm1r/QodeAssist.git
synced 2025-11-13 13:32:55 -05:00
feat: Add chat-agent switcher in chat ui (#247)
* feat: Add chat-agent switcher in chat ui fix: qml errors refactor: Change top bar layout fix: default value * fix: update github action for qtc
This commit is contained in:
@ -49,6 +49,7 @@ ChatRootView::ChatRootView(QQuickItem *parent)
|
||||
, m_promptProvider(LLMCore::PromptTemplateManager::instance())
|
||||
, m_clientInterface(new ClientInterface(m_chatModel, &m_promptProvider, this))
|
||||
, m_isRequestInProgress(false)
|
||||
, m_isAgentMode(false)
|
||||
{
|
||||
m_isSyncOpenFiles = Settings::chatAssistantSettings().linkOpenFiles();
|
||||
connect(
|
||||
@ -142,12 +143,20 @@ ChatRootView::ChatRootView(QQuickItem *parent)
|
||||
updateInputTokensCount();
|
||||
refreshRules();
|
||||
|
||||
// Refresh rules when project changes
|
||||
connect(
|
||||
ProjectExplorer::ProjectManager::instance(),
|
||||
&ProjectExplorer::ProjectManager::startupProjectChanged,
|
||||
this,
|
||||
&ChatRootView::refreshRules);
|
||||
|
||||
QSettings appSettings;
|
||||
m_isAgentMode = appSettings.value("QodeAssist/Chat/AgentMode", true).toBool();
|
||||
|
||||
connect(
|
||||
&Settings::generalSettings().useTools,
|
||||
&Utils::BaseAspect::changed,
|
||||
this,
|
||||
&ChatRootView::toolsSupportEnabledChanged);
|
||||
}
|
||||
|
||||
ChatModel *ChatRootView::chatModel() const
|
||||
@ -173,7 +182,7 @@ void ChatRootView::sendMessage(const QString &message)
|
||||
}
|
||||
}
|
||||
|
||||
m_clientInterface->sendMessage(message, m_attachmentFiles, m_linkedFiles);
|
||||
m_clientInterface->sendMessage(message, m_attachmentFiles, m_linkedFiles, m_isAgentMode);
|
||||
clearAttachmentFiles();
|
||||
setRequestProgressStatus(true);
|
||||
}
|
||||
@ -704,4 +713,26 @@ void ChatRootView::refreshRules()
|
||||
emit activeRulesCountChanged();
|
||||
}
|
||||
|
||||
bool ChatRootView::isAgentMode() const
|
||||
{
|
||||
return m_isAgentMode;
|
||||
}
|
||||
|
||||
void ChatRootView::setIsAgentMode(bool newIsAgentMode)
|
||||
{
|
||||
if (m_isAgentMode != newIsAgentMode) {
|
||||
m_isAgentMode = newIsAgentMode;
|
||||
|
||||
QSettings settings;
|
||||
settings.setValue("QodeAssist/Chat/AgentMode", newIsAgentMode);
|
||||
|
||||
emit isAgentModeChanged();
|
||||
}
|
||||
}
|
||||
|
||||
bool ChatRootView::toolsSupportEnabled() const
|
||||
{
|
||||
return Settings::generalSettings().useTools();
|
||||
}
|
||||
|
||||
} // namespace QodeAssist::Chat
|
||||
|
||||
Reference in New Issue
Block a user