diff --git a/panel.js b/panel.js index 1ad1631..c24d8a8 100644 --- a/panel.js +++ b/panel.js @@ -80,7 +80,7 @@ const TASK_PROFILE_GENERATION_GROUPS = [ { key: "max_completion_tokens", label: "最大补全 Tokens", type: "number", defaultValue: "" }, { key: "reply_count", label: "回复次数", type: "number", defaultValue: 1 }, { key: "stream", label: "流式输出", type: "tri_bool", defaultValue: false }, - { key: "temperature", label: "温度 (Temperature)", type: "range", min: 0, max: 2, step: 0.01, defaultValue: 0.7 }, + { key: "temperature", label: "温度 (Temperature)", type: "range", min: 0, max: 2, step: 0.01, defaultValue: 1 }, { key: "top_p", label: "Top P", type: "range", min: 0, max: 1, step: 0.01, defaultValue: 1 }, { key: "top_k", label: "Top K", type: "number", defaultValue: 0 }, { key: "top_a", label: "Top A", type: "range", min: 0, max: 1, step: 0.01, defaultValue: 0 }, @@ -2074,6 +2074,25 @@ async function _handleTaskProfileWorkspaceClick(event) { case "import-all-profiles": document.getElementById("bme-task-profile-import-all")?.click(); return; + case "restore-all-profiles": { + const confirmed = window.confirm( + "这会将全部 6 个任务的默认预设恢复为出厂状态。已保存的自定义预设不受影响。是否继续?", + ); + if (!confirmed) return; + const taskTypes = getTaskTypeOptions().map((t) => t.id); + let restored = state.taskProfiles; + const extraPatch = {}; + for (const tt of taskTypes) { + restored = restoreDefaultTaskProfile(restored, tt); + const lf = getLegacyPromptFieldForTask(tt); + if (lf) extraPatch[lf] = ""; + } + currentTaskProfileBlockId = ""; + currentTaskProfileRuleId = ""; + _patchTaskProfiles(restored, extraPatch); + toastr.success(`已恢复全部 ${taskTypes.length} 个任务的默认预设`, "ST-BME"); + return; + } case "restore-default-profile": { const confirmed = window.confirm( "这会重建当前任务的默认预设,并切换到默认预设。是否继续?", @@ -2156,6 +2175,9 @@ function _renderTaskProfileWorkspace(state) { +