🫥 | Commit... yeah, commit.
This commit is contained in:
@@ -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];
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user