From 642f498e794fd1e13769fbfade26f6a072491628 Mon Sep 17 00:00:00 2001 From: NikkeDoy Date: Tue, 5 May 2026 12:57:06 +0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=AB=A5=20|=20Commit...=20yeah,=20commit.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- contents/config/main.xml | 10 ---------- contents/ui/configGeneral.qml | 13 +++++++++++++ contents/ui/main.qml | 15 ++++++++++++++- 3 files changed, 27 insertions(+), 11 deletions(-) diff --git a/contents/config/main.xml b/contents/config/main.xml index f06100d..e69de29 100644 --- a/contents/config/main.xml +++ b/contents/config/main.xml @@ -1,10 +0,0 @@ - - - - - - You are a helpful assistant. Your answers are compact. - - - - diff --git a/contents/ui/configGeneral.qml b/contents/ui/configGeneral.qml index 86702c3..0d7f33f 100644 --- a/contents/ui/configGeneral.qml +++ b/contents/ui/configGeneral.qml @@ -6,6 +6,7 @@ import org.kde.kirigami as Kirigami Kirigami.Page { id: page property alias cfg_systemPrompt: systemPrompt.text + property alias cfg_defaultModel: defaultModelField.text contentItem: ColumnLayout { Kirigami.Heading { @@ -22,5 +23,17 @@ Kirigami.Page { wrapMode: TextEdit.Wrap clip: true } + + Kirigami.Heading { + text: "Default Model" + level: 3 + Layout.fillWidth: true + } + + QQC2.TextField { + id: defaultModelField + placeholderText: "Enter the default model name (e.g., llama3)" + Layout.fillWidth: true + } } } diff --git a/contents/ui/main.qml b/contents/ui/main.qml index 4a90270..a1b3067 100644 --- a/contents/ui/main.qml +++ b/contents/ui/main.qml @@ -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]; + } } } };