Merge pull request #999 from StefanDanielSchwarz/roleplay-context

Return of the Roleplay Context
This commit is contained in:
Cohee
2023-08-24 00:29:05 +03:00
committed by GitHub
5 changed files with 124 additions and 26 deletions

View File

@ -20,7 +20,11 @@ import {
groups,
resetSelectedGroup,
} from "./group-chats.js";
import { loadInstructMode } from "./instruct-mode.js";
import {
instruct_presets,
loadInstructMode,
selectInstructPreset,
} from "./instruct-mode.js";
import { registerSlashCommand } from "./slash-commands.js";
import { tokenizers } from "./tokenizers.js";
@ -193,7 +197,7 @@ let power_user = {
let themes = [];
let movingUIPresets = [];
let context_presets = [];
export let context_presets = [];
const storage_keys = {
fast_ui_mode: "TavernAI_fast_ui_mode",
@ -920,6 +924,15 @@ function loadContextSettings() {
}
}
});
// Select matching instruct preset
for (const instruct_preset of instruct_presets) {
// If instruct preset matches the context template
if (instruct_preset.name === name) {
selectInstructPreset(instruct_preset.name);
break;
}
}
});
}