From 83bc08e8101a9eb7c1f86fea3caca93e55f23582 Mon Sep 17 00:00:00 2001 From: end-4 <97237370+end-4@users.noreply.github.com> Date: Tue, 17 Jun 2025 00:30:59 +0200 Subject: [PATCH] sidebar: ai chat: clearer "pls /key" for newcomers --- .config/quickshell/modules/sidebarLeft/AiChat.qml | 2 +- .config/quickshell/services/Ai.qml | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.config/quickshell/modules/sidebarLeft/AiChat.qml b/.config/quickshell/modules/sidebarLeft/AiChat.qml index 1ce752c7b..422dc41b8 100644 --- a/.config/quickshell/modules/sidebarLeft/AiChat.qml +++ b/.config/quickshell/modules/sidebarLeft/AiChat.qml @@ -244,7 +244,7 @@ Inline w/ backslash and round brackets \\(e^{i\\pi} + 1 = 0\\) color: Appearance.m3colors.m3outline horizontalAlignment: Text.AlignLeft wrapMode: Text.Wrap - text: qsTr("Ctrl+O to expand the sidebar\nCtrl+P to detach sidebar into a window") + text: qsTr("Type /key to get started with online models\nCtrl+O to expand the sidebar\nCtrl+P to detach sidebar into a window") } } } diff --git a/.config/quickshell/services/Ai.qml b/.config/quickshell/services/Ai.qml index 9a5ef5124..f545b878f 100644 --- a/.config/quickshell/services/Ai.qml +++ b/.config/quickshell/services/Ai.qml @@ -298,6 +298,8 @@ Singleton { modelId = modelId.toLowerCase() if (modelList.indexOf(modelId) !== -1) { const model = models[modelId] + // Fetch API keys if needed + if (model?.requires_key) KeyringStorage.fetchKeyringData(); // See if policy prevents online models if (ConfigOptions.policies.ai === 2 && !model.endpoint.includes("localhost")) { root.addMessage(StringUtils.format(StringUtils.format("Online models disallowed\n\nControlled by `policies.ai` config option"), model.name), root.interfaceRole); @@ -314,9 +316,6 @@ Singleton { } else { if (feedback) root.addMessage(qsTr("Invalid model. Supported: \n```\n") + modelList.join("\n```\n```\n"), Ai.interfaceRole) + "\n```" } - if (models[modelId]?.requires_key) { - KeyringStorage.fetchKeyringData(); - } } function getTemperature() {