mirror of
https://github.com/Palm1r/QodeAssist.git
synced 2026-03-31 09:52:44 -04:00
feat: Add todo tool (#286)
This commit is contained in:
@ -311,6 +311,12 @@ void ChatRootView::clearLinkedFiles()
|
||||
emit linkedFilesChanged();
|
||||
}
|
||||
|
||||
void ChatRootView::clearMessages()
|
||||
{
|
||||
m_clientInterface->clearMessages();
|
||||
clearLinkedFiles();
|
||||
}
|
||||
|
||||
QString ChatRootView::getChatsHistoryDir() const
|
||||
{
|
||||
QString path;
|
||||
|
||||
@ -161,6 +161,7 @@ public slots:
|
||||
void cancelRequest();
|
||||
void clearAttachmentFiles();
|
||||
void clearLinkedFiles();
|
||||
void clearMessages();
|
||||
|
||||
signals:
|
||||
void chatModelChanged();
|
||||
|
||||
@ -318,12 +318,23 @@ void ClientInterface::sendMessage(
|
||||
Qt::UniqueConnection);
|
||||
|
||||
provider->sendRequest(requestId, config.url, config.providerRequest);
|
||||
|
||||
if (provider->supportsTools() && provider->toolsManager()) {
|
||||
provider->toolsManager()->setCurrentSessionId(m_chatFilePath);
|
||||
}
|
||||
}
|
||||
|
||||
void ClientInterface::clearMessages()
|
||||
{
|
||||
const auto providerName = Settings::generalSettings().caProvider();
|
||||
auto *provider = LLMCore::ProvidersManager::instance().getProviderByName(providerName);
|
||||
|
||||
if (provider && !m_chatFilePath.isEmpty() && provider->supportsTools()
|
||||
&& provider->toolsManager()) {
|
||||
provider->toolsManager()->clearTodoSession(m_chatFilePath);
|
||||
}
|
||||
|
||||
m_chatModel->clear();
|
||||
LOG_MESSAGE("Chat history cleared");
|
||||
}
|
||||
|
||||
void ClientInterface::cancelRequest()
|
||||
@ -596,6 +607,15 @@ QVector<LLMCore::ImageAttachment> ClientInterface::loadImagesFromStorage(
|
||||
|
||||
void ClientInterface::setChatFilePath(const QString &filePath)
|
||||
{
|
||||
if (!m_chatFilePath.isEmpty() && m_chatFilePath != filePath) {
|
||||
const auto providerName = Settings::generalSettings().caProvider();
|
||||
auto *provider = LLMCore::ProvidersManager::instance().getProviderByName(providerName);
|
||||
|
||||
if (provider && provider->supportsTools() && provider->toolsManager()) {
|
||||
provider->toolsManager()->clearTodoSession(m_chatFilePath);
|
||||
}
|
||||
}
|
||||
|
||||
m_chatFilePath = filePath;
|
||||
m_chatModel->setChatFilePath(filePath);
|
||||
}
|
||||
|
||||
@ -446,7 +446,7 @@ ChatRootView {
|
||||
}
|
||||
|
||||
function clearChat() {
|
||||
root.chatModel.clear()
|
||||
root.clearMessages()
|
||||
root.clearAttachmentFiles()
|
||||
root.updateInputTokensCount()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user