sidebar: ai chat: clearer "pls /key" for newcomers

This commit is contained in:
end-4
2025-06-17 00:30:59 +02:00
parent 36e87fe71f
commit 83bc08e810
2 changed files with 3 additions and 4 deletions
@@ -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")
}
}
}
+2 -3
View File
@@ -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() {