Show warnings when prompt bits are overridden by the character card.

This commit is contained in:
Cohee
2023-06-08 23:37:52 +03:00
parent 8c73bbf2c5
commit a95e321099
3 changed files with 32 additions and 8 deletions

View File

@@ -5446,6 +5446,19 @@ function updateVisibleDivs(containerSelector, resizecontainer) {
});
}
function displayOverrideWarnings() {
if (!this_chid) {
return;
}
$('.prompt_overridden').toggle(!!(characters[this_chid]?.data?.system_prompt));
$('.jailbreak_overridden').toggle(!!(characters[this_chid]?.data?.post_history_instructions));
}
// Check for override warnings every 5 seconds...
setInterval(displayOverrideWarnings, 5000);
// ...or when the chat changes
eventSource.on(event_types.CHAT_CHANGED, displayOverrideWarnings);
function importCharacter(file) {
const ext = file.name.match(/\.(\w+)$/);