Use prefix in the migrated sysprompts

This commit is contained in:
Cohee 2024-09-22 21:06:03 +03:00
parent 4ee771b7af
commit c340766bb6
2 changed files with 2 additions and 1 deletions

View File

@ -29,7 +29,7 @@ async function migrateSystemPromptFromInstructMode() {
if (existingPromptName) {
power_user.sysprompt.name = existingPromptName;
} else {
const data = { name: `${power_user.instruct.preset} (Migrated)`, content: prompt };
const data = { name: `[Migrated] ${power_user.instruct.preset}`, content: prompt };
await getPresetManager('sysprompt')?.savePreset(data.name, data);
power_user.sysprompt.name = data.name;
}

View File

@ -368,6 +368,7 @@ async function migrateSystemPrompts() {
// Only leave contents that are not in the default prompts
migratedPrompts = migratedPrompts.filter(x => !defaultPrompts.some(y => y.content === x.content));
for (const sysPromptData of migratedPrompts) {
sysPromptData.name = `[Migrated] ${sysPromptData.name}`;
const syspromptPath = path.join(directory.sysprompt, `${sysPromptData.name}.json`);
writeFileAtomicSync(syspromptPath, JSON.stringify(sysPromptData, null, 4));
console.log(`Migrated system prompt ${sysPromptData.name} for ${directory.root.split(path.sep).pop()}`);