From b4f969908f3b7976ed39ffaffb4391260e2e9388 Mon Sep 17 00:00:00 2001 From: Petr Mironychev <9195189+Palm1r@users.noreply.github.com> Date: Thu, 29 Aug 2024 22:46:03 +0200 Subject: [PATCH] Fix typo --- LLMClientInterface.cpp | 14 +++++++------- qodeassist.cpp | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/LLMClientInterface.cpp b/LLMClientInterface.cpp index 58de612..77f88cf 100644 --- a/LLMClientInterface.cpp +++ b/LLMClientInterface.cpp @@ -177,7 +177,7 @@ void LLMClientInterface::handleInitialize(const QJsonObject &request) result["capabilities"] = capabilities; QJsonObject serverInfo; - serverInfo["name"] = "Ollama LSP Server"; + serverInfo["name"] = "QodeAssist LSP Server"; serverInfo["version"] = "0.1"; result["serverInfo"] = serverInfo; @@ -324,22 +324,22 @@ void LLMClientInterface::sendCompletionToClient(const QString &completion, void LLMClientInterface::sendLLMRequest(const QJsonObject &request, const ContextPair &prompt) { - QJsonObject ollamaRequest = {{"model", settings().modelName.value()}, {"stream", true}}; + QJsonObject qodeRequest = {{"model", settings().modelName.value()}, {"stream", true}}; auto currentTemplate = PromptTemplateManager::instance().getCurrentTemplate(); - currentTemplate->prepareRequest(ollamaRequest, prompt.prefix, prompt.suffix); + currentTemplate->prepareRequest(qodeRequest, prompt.prefix, prompt.suffix); auto &providerManager = LLMProvidersManager::instance(); - providerManager.getCurrentProvider()->prepareRequest(ollamaRequest); + providerManager.getCurrentProvider()->prepareRequest(qodeRequest); logMessage( QString("Sending request to llm: \nurl: %1\nRequest body:\n%2") .arg(m_serverUrl.toString()) - .arg(QString::fromUtf8(QJsonDocument(ollamaRequest).toJson(QJsonDocument::Indented)))); + .arg(QString::fromUtf8(QJsonDocument(qodeRequest).toJson(QJsonDocument::Indented)))); QNetworkRequest networkRequest(m_serverUrl); networkRequest.setHeader(QNetworkRequest::ContentTypeHeader, "application/json"); - QNetworkReply *reply = m_manager->post(networkRequest, QJsonDocument(ollamaRequest).toJson()); + QNetworkReply *reply = m_manager->post(networkRequest, QJsonDocument(qodeRequest).toJson()); if (!reply) { logMessage("Error: Failed to create network reply"); return; @@ -356,7 +356,7 @@ void LLMClientInterface::sendLLMRequest(const QJsonObject &request, const Contex reply->deleteLater(); m_activeRequests.remove(requestId); if (reply->error() != QNetworkReply::NoError) { - logMessage(QString("Error in Ollama request: %1").arg(reply->errorString())); + logMessage(QString("Error in QodeAssist request: %1").arg(reply->errorString())); } else { logMessage("Request finished successfully"); } diff --git a/qodeassist.cpp b/qodeassist.cpp index 86faf47..bb37aba 100644 --- a/qodeassist.cpp +++ b/qodeassist.cpp @@ -85,7 +85,7 @@ public: ActionBuilder requestAction(this, Constants::QODE_ASSIST_REQUEST_SUGGESTION); requestAction.setToolTip( Tr::tr("Generate Qode Assist suggestion at the current cursor position.")); - requestAction.setText(Tr::tr("Request Ollama Suggestion")); + requestAction.setText(Tr::tr("Request QodeAssist Suggestion")); requestAction.setIcon(QCODEASSIST_ICON.icon()); const QKeySequence defaultShortcut = QKeySequence(Qt::CTRL | Qt::ALT | Qt::Key_Q); requestAction.setDefaultKeySequence(defaultShortcut);