feat: Add todo tool (#286)

This commit is contained in:
Petr Mironychev
2025-12-03 21:28:59 +01:00
committed by GitHub
parent fb941cea99
commit 498eb4d932
17 changed files with 563 additions and 13 deletions

View File

@ -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);
}