chore: Run clang-format over the codebase (#82)

This commit is a result of the following commands:

clang-format-19 --style=file -i $(git ls-files | fgrep .cpp)
clang-format-19 --style=file -i $(git ls-files | fgrep .hpp)
This commit is contained in:
Povilas Kanapickas
2025-03-02 23:44:20 +02:00
committed by GitHub
parent 102bb114a1
commit 61196cae90
35 changed files with 253 additions and 264 deletions

View File

@ -33,15 +33,16 @@ RequestHandler::RequestHandler(QObject *parent)
void RequestHandler::sendLLMRequest(const LLMConfig &config, const QJsonObject &request)
{
LOG_MESSAGE(QString("Sending request to llm: \nurl: %1\nRequest body:\n%2")
.arg(config.url.toString(),
.arg(
config.url.toString(),
QString::fromUtf8(
QJsonDocument(config.providerRequest).toJson(QJsonDocument::Indented))));
QNetworkRequest networkRequest(config.url);
config.provider->prepareNetworkRequest(networkRequest);
QNetworkReply *reply = m_manager->post(networkRequest,
QJsonDocument(config.providerRequest).toJson());
QNetworkReply *reply
= m_manager->post(networkRequest, QJsonDocument(config.providerRequest).toJson());
if (!reply) {
LOG_MESSAGE("Error: Failed to create network reply");
return;
@ -70,9 +71,8 @@ void RequestHandler::sendLLMRequest(const LLMConfig &config, const QJsonObject &
});
}
void RequestHandler::handleLLMResponse(QNetworkReply *reply,
const QJsonObject &request,
const LLMConfig &config)
void RequestHandler::handleLLMResponse(
QNetworkReply *reply, const QJsonObject &request, const LLMConfig &config)
{
QString &accumulatedResponse = m_accumulatedResponses[reply];
@ -85,8 +85,8 @@ void RequestHandler::handleLLMResponse(QNetworkReply *reply,
}
if (isComplete) {
auto cleanedCompletion = removeStopWords(accumulatedResponse,
config.promptTemplate->stopWords());
auto cleanedCompletion
= removeStopWords(accumulatedResponse, config.promptTemplate->stopWords());
emit completionReceived(cleanedCompletion, request, true);
}