mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Use prefix in the migrated sysprompts
This commit is contained in:
@@ -29,7 +29,7 @@ async function migrateSystemPromptFromInstructMode() {
|
|||||||
if (existingPromptName) {
|
if (existingPromptName) {
|
||||||
power_user.sysprompt.name = existingPromptName;
|
power_user.sysprompt.name = existingPromptName;
|
||||||
} else {
|
} 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);
|
await getPresetManager('sysprompt')?.savePreset(data.name, data);
|
||||||
power_user.sysprompt.name = data.name;
|
power_user.sysprompt.name = data.name;
|
||||||
}
|
}
|
||||||
|
@@ -368,6 +368,7 @@ async function migrateSystemPrompts() {
|
|||||||
// Only leave contents that are not in the default prompts
|
// Only leave contents that are not in the default prompts
|
||||||
migratedPrompts = migratedPrompts.filter(x => !defaultPrompts.some(y => y.content === x.content));
|
migratedPrompts = migratedPrompts.filter(x => !defaultPrompts.some(y => y.content === x.content));
|
||||||
for (const sysPromptData of migratedPrompts) {
|
for (const sysPromptData of migratedPrompts) {
|
||||||
|
sysPromptData.name = `[Migrated] ${sysPromptData.name}`;
|
||||||
const syspromptPath = path.join(directory.sysprompt, `${sysPromptData.name}.json`);
|
const syspromptPath = path.join(directory.sysprompt, `${sysPromptData.name}.json`);
|
||||||
writeFileAtomicSync(syspromptPath, JSON.stringify(sysPromptData, null, 4));
|
writeFileAtomicSync(syspromptPath, JSON.stringify(sysPromptData, null, 4));
|
||||||
console.log(`Migrated system prompt ${sysPromptData.name} for ${directory.root.split(path.sep).pop()}`);
|
console.log(`Migrated system prompt ${sysPromptData.name} for ${directory.root.split(path.sep).pop()}`);
|
||||||
|
Reference in New Issue
Block a user