From f765fdf531805a9890450c77b0efc48c95b01fdf Mon Sep 17 00:00:00 2001 From: end-4 <97237370+end-4@users.noreply.github.com> Date: Mon, 26 May 2025 10:45:59 +0200 Subject: [PATCH] ai: fix invalid message when switching model --- .config/quickshell/services/Ai.qml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.config/quickshell/services/Ai.qml b/.config/quickshell/services/Ai.qml index 7c33cd249..757a2a1e3 100644 --- a/.config/quickshell/services/Ai.qml +++ b/.config/quickshell/services/Ai.qml @@ -8,6 +8,9 @@ import Quickshell.Io; import Qt.labs.platform import QtQuick; +/** + * Basic service to handle LLM chats. Supports Google's and OpenAI's API formats. + */ Singleton { id: root @@ -184,7 +187,7 @@ Singleton { modelId = modelId.toLowerCase() if (modelList.indexOf(modelId) !== -1) { PersistentStateManager.setState("ai.model", modelId); - if (feedback) root.addMessage(StringUtils.format(StringUtils.format("Model set to {0}"), models[modelId].name, Ai.interfaceRole)) + if (feedback) root.addMessage(StringUtils.format(StringUtils.format("Model set to {0}"), models[modelId].name), Ai.interfaceRole) if (models[modelId].requires_key) { // If key not there show advice if (root.apiKeysLoaded && (!root.apiKeys[models[modelId].key_id] || root.apiKeys[models[modelId].key_id].length === 0)) {