Files
QodeAssist/llmcore/Provider.cpp
Petr Mironychev 10b924d78a Feat: Add Claude tools support to plugin (#231)
* feat: Add settings for handle using tools in chat
* feat: Add Claude tools support
* fix: Add ai ignore to read project files list tool
* fix: Add ai ignore to read project file by name tool
* fix: Add ai ignore to read current opened files tool
2025-09-30 23:19:46 +02:00

37 lines
838 B
C++

#include "Provider.hpp"
#include <QJsonDocument>
namespace QodeAssist::LLMCore {
Provider::Provider(QObject *parent)
: QObject(parent)
, m_httpClient(new HttpClient(this))
{
connect(m_httpClient, &HttpClient::dataReceived, this, &Provider::onDataReceived);
connect(m_httpClient, &HttpClient::requestFinished, this, &Provider::onRequestFinished);
}
void Provider::cancelRequest(const RequestID &requestId)
{
m_httpClient->cancelRequest(requestId);
}
HttpClient *Provider::httpClient() const
{
return m_httpClient;
}
QJsonObject Provider::parseEventLine(const QString &line)
{
if (!line.startsWith("data: "))
return QJsonObject();
QString jsonStr = line.mid(6);
QJsonDocument doc = QJsonDocument::fromJson(jsonStr.toUtf8());
return doc.object();
}
} // namespace QodeAssist::LLMCore