🫥 | Commit... yeah, commit.
This commit is contained in:
@@ -1,10 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" ?>
|
|
||||||
<kcfg xmlns="http://www.kde.org/standards/kcfg/1.0">
|
|
||||||
<group name="General">
|
|
||||||
<entry name="systemPrompt" type="String">
|
|
||||||
<default>
|
|
||||||
You are a helpful assistant. Your answers are compact.
|
|
||||||
</default>
|
|
||||||
</entry>
|
|
||||||
</group>
|
|
||||||
</kcfg>
|
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import org.kde.kirigami as Kirigami
|
|||||||
Kirigami.Page {
|
Kirigami.Page {
|
||||||
id: page
|
id: page
|
||||||
property alias cfg_systemPrompt: systemPrompt.text
|
property alias cfg_systemPrompt: systemPrompt.text
|
||||||
|
property alias cfg_defaultModel: defaultModelField.text
|
||||||
|
|
||||||
contentItem: ColumnLayout {
|
contentItem: ColumnLayout {
|
||||||
Kirigami.Heading {
|
Kirigami.Heading {
|
||||||
@@ -22,5 +23,17 @@ Kirigami.Page {
|
|||||||
wrapMode: TextEdit.Wrap
|
wrapMode: TextEdit.Wrap
|
||||||
clip: true
|
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
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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 string ollamaUrl: "http://localhost:11434"
|
||||||
property var models: []
|
property var models: []
|
||||||
property string currentModel: ""
|
property string currentModel: ""
|
||||||
@@ -74,8 +83,12 @@ PlasmoidItem {
|
|||||||
if (res.models) {
|
if (res.models) {
|
||||||
res.models.forEach(m => list.push(m.name));
|
res.models.forEach(m => list.push(m.name));
|
||||||
models = list;
|
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];
|
currentModel = list[0];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user