forked from Shinonome/dots-hyprland
sidebar: ai chat: clearer "pls /key" for newcomers
This commit is contained in:
@@ -244,7 +244,7 @@ Inline w/ backslash and round brackets \\(e^{i\\pi} + 1 = 0\\)
|
|||||||
color: Appearance.m3colors.m3outline
|
color: Appearance.m3colors.m3outline
|
||||||
horizontalAlignment: Text.AlignLeft
|
horizontalAlignment: Text.AlignLeft
|
||||||
wrapMode: Text.Wrap
|
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")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -298,6 +298,8 @@ Singleton {
|
|||||||
modelId = modelId.toLowerCase()
|
modelId = modelId.toLowerCase()
|
||||||
if (modelList.indexOf(modelId) !== -1) {
|
if (modelList.indexOf(modelId) !== -1) {
|
||||||
const model = models[modelId]
|
const model = models[modelId]
|
||||||
|
// Fetch API keys if needed
|
||||||
|
if (model?.requires_key) KeyringStorage.fetchKeyringData();
|
||||||
// See if policy prevents online models
|
// See if policy prevents online models
|
||||||
if (ConfigOptions.policies.ai === 2 && !model.endpoint.includes("localhost")) {
|
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);
|
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 {
|
} else {
|
||||||
if (feedback) root.addMessage(qsTr("Invalid model. Supported: \n```\n") + modelList.join("\n```\n```\n"), Ai.interfaceRole) + "\n```"
|
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() {
|
function getTemperature() {
|
||||||
|
|||||||
Reference in New Issue
Block a user