🫥 | Commit... yeah, commit.

This commit is contained in:
2026-05-05 12:57:06 +03:00
parent 55917b9d1a
commit 642f498e79
3 changed files with 27 additions and 11 deletions

View File

@@ -20,6 +20,15 @@ PlasmoidItem {
}
}
Connections {
target: plasmoid.configuration
function onDefaultModelChanged() {
if (models.includes(plasmoid.configuration.defaultModel)) {
currentModel = plasmoid.configuration.defaultModel;
}
}
}
property string ollamaUrl: "http://localhost:11434"
property var models: []
property string currentModel: ""
@@ -74,8 +83,12 @@ PlasmoidItem {
if (res.models) {
res.models.forEach(m => list.push(m.name));
models = list;
if (list.length > 0 && currentModel === "")
// Prefer user configured default model if present
if (plasmoid.configuration.defaultModel && list.includes(plasmoid.configuration.defaultModel)) {
currentModel = plasmoid.configuration.defaultModel;
} else if (list.length > 0 && currentModel === "") {
currentModel = list[0];
}
}
}
};