diff --git a/.config/quickshell/modules/common/PersistentStates.qml b/.config/quickshell/modules/common/PersistentStates.qml index d3b8fa79f..4c9a7608c 100644 --- a/.config/quickshell/modules/common/PersistentStates.qml +++ b/.config/quickshell/modules/common/PersistentStates.qml @@ -4,6 +4,10 @@ pragma Singleton pragma ComponentBehavior: Bound Singleton { + property QtObject ai: QtObject { + property string model: "gemini-2.0-flash-search" + } + property QtObject sidebar: QtObject { property QtObject leftSide: QtObject { property int selectedTab: 0 diff --git a/.config/quickshell/services/Ai.qml b/.config/quickshell/services/Ai.qml index de265e6e8..f1d972390 100644 --- a/.config/quickshell/services/Ai.qml +++ b/.config/quickshell/services/Ai.qml @@ -77,7 +77,7 @@ Singleton { }, } property var modelList: Object.keys(root.models) - property var currentModel: Object.keys(root.models)[0] + property var currentModel: PersistentStates.ai.model Component.onCompleted: { setModel(currentModel, false); // Do necessary setup for model @@ -163,7 +163,7 @@ Singleton { if (!model) model = "" model = model.toLowerCase() if (modelList.indexOf(model) !== -1) { - currentModel = model + PersistentStateManager.setState("ai.model", model); if (feedback) root.addMessage("Model set to " + models[model].name, Ai.interfaceRole) if (models[model].requires_key) { // If key not there show advice