mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Show warnings when prompt bits are overridden by the character card.
This commit is contained in:
@@ -988,6 +988,9 @@
|
|||||||
<div class="fa-solid fa-clock-rotate-left "></div>
|
<div class="fa-solid fa-clock-rotate-left "></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="prompt_overridden">
|
||||||
|
Overridden by the Character Definitions.
|
||||||
|
</div>
|
||||||
<div class="toggle-description justifyLeft" data-i18n="The main prompt used to set the model behavior">
|
<div class="toggle-description justifyLeft" data-i18n="The main prompt used to set the model behavior">
|
||||||
The main prompt used to set the model behavior
|
The main prompt used to set the model behavior
|
||||||
</div>
|
</div>
|
||||||
@@ -1030,6 +1033,9 @@
|
|||||||
<div class="fa-solid fa-clock-rotate-left"></div>
|
<div class="fa-solid fa-clock-rotate-left"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="jailbreak_overridden">
|
||||||
|
Overridden by the Character Definitions.
|
||||||
|
</div>
|
||||||
<div class="toggle-description justifyLeft" data-i18n="Prompt that is used when the Jailbreak toggle is on">
|
<div class="toggle-description justifyLeft" data-i18n="Prompt that is used when the Jailbreak toggle is on">
|
||||||
Prompt that is used when the Jailbreak toggle is on
|
Prompt that is used when the Jailbreak toggle is on
|
||||||
</div>
|
</div>
|
||||||
@@ -1546,6 +1552,9 @@
|
|||||||
<label>
|
<label>
|
||||||
<span data-i18n="System Prompt">System Prompt</span>
|
<span data-i18n="System Prompt">System Prompt</span>
|
||||||
</label>
|
</label>
|
||||||
|
<div class="prompt_overridden">
|
||||||
|
Overridden by the Character Definitions.
|
||||||
|
</div>
|
||||||
<textarea id="instruct_system_prompt" class="text_pole textarea_compact"></textarea>
|
<textarea id="instruct_system_prompt" class="text_pole textarea_compact"></textarea>
|
||||||
<div class="flex-container">
|
<div class="flex-container">
|
||||||
<div class="flex1">
|
<div class="flex1">
|
||||||
@@ -1801,11 +1810,8 @@
|
|||||||
<div id="world_popup">
|
<div id="world_popup">
|
||||||
<hr>
|
<hr>
|
||||||
<div id="world_popup_text">
|
<div id="world_popup_text">
|
||||||
<!-- <div id="world_cross" class="fa-solid fa-circle-xmark"></div> -->
|
|
||||||
<div id="world_popup_header" class="flex-container flexGap5">
|
<div id="world_popup_header" class="flex-container flexGap5">
|
||||||
<!-- Consider changing logo to something else -->
|
|
||||||
<div class="world_popup_logo_block">
|
<div class="world_popup_logo_block">
|
||||||
<!-- <img src="img/book2.png" id="world_logo"> -->
|
|
||||||
<h3>
|
<h3>
|
||||||
World Info Editor
|
World Info Editor
|
||||||
<a href="https://docs.sillytavern.app/usage/guidebook/#world-info-entry" class="notes-link" target="_blank"><span class="note-link-span">?</span></a>
|
<a href="https://docs.sillytavern.app/usage/guidebook/#world-info-entry" class="notes-link" target="_blank"><span class="note-link-span">?</span></a>
|
||||||
@@ -1813,7 +1819,6 @@
|
|||||||
</div>
|
</div>
|
||||||
<div id="OpenAllWIEntries" class="menu_button fa-solid fa-expand"></div>
|
<div id="OpenAllWIEntries" class="menu_button fa-solid fa-expand"></div>
|
||||||
<div id="CloseAllWIEntries" class="menu_button fa-solid fa-compress"></div>
|
<div id="CloseAllWIEntries" class="menu_button fa-solid fa-compress"></div>
|
||||||
<!-- <div class="world_popup_expander"> </div> -->
|
|
||||||
<form id="form_rename_world" action="javascript:void(null);" method="post" enctype="multipart/form-data">
|
<form id="form_rename_world" action="javascript:void(null);" method="post" enctype="multipart/form-data">
|
||||||
<input id="world_popup_name" name="world_popup_name" class="text_pole" maxlength="99" size="32" value="" autocomplete="off">
|
<input id="world_popup_name" name="world_popup_name" class="text_pole" maxlength="99" size="32" value="" autocomplete="off">
|
||||||
<input id="world_popup_name_button" class="menu_button" type="submit" value="Rename">
|
<input id="world_popup_name_button" class="menu_button" type="submit" value="Rename">
|
||||||
@@ -1826,7 +1831,6 @@
|
|||||||
|
|
||||||
<div id="world_popup_bottom_holder">
|
<div id="world_popup_bottom_holder">
|
||||||
<div id="world_popup_new" class="menu_button">New Entry</div>
|
<div id="world_popup_new" class="menu_button">New Entry</div>
|
||||||
<!-- <span class="world_popup_expander"> </span> -->
|
|
||||||
<div id="world_popup_export" class="menu_button">Export</div>
|
<div id="world_popup_export" class="menu_button">Export</div>
|
||||||
<div id="world_popup_delete" class="menu_button">Delete World</div>
|
<div id="world_popup_delete" class="menu_button">Delete World</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -2469,11 +2473,11 @@
|
|||||||
<div class="inline-drawer-content">
|
<div class="inline-drawer-content">
|
||||||
<div>
|
<div>
|
||||||
<h4>System Prompt</h4>
|
<h4>System Prompt</h4>
|
||||||
<textarea id="system_prompt_textarea" name="system_prompt" placeholder="(Overrides the main prompt for OpenAI and/or system prompt for Instruct Mode if not empty)" form="form_create" class="text_pole" autocomplete="off" rows="3" maxlength="20000"></textarea>
|
<textarea id="system_prompt_textarea" name="system_prompt" placeholder="(Overrides the main prompt for Chat Completion and/or system prompt for Instruct Mode if not empty)" form="form_create" class="text_pole" autocomplete="off" rows="3" maxlength="20000"></textarea>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<h4>Post History Instructions</h4>
|
<h4>Post History Instructions</h4>
|
||||||
<textarea id="post_history_instructions_textarea" name="post_history_instructions" placeholder="(Overrides the default jailbreak for OpenAI if not empty)" form="form_create" class="text_pole" autocomplete="off" rows="3" maxlength="100"></textarea>
|
<textarea id="post_history_instructions_textarea" name="post_history_instructions" placeholder="(Overrides the default jailbreak for Chat Completion if not empty)" form="form_create" class="text_pole" autocomplete="off" rows="3" maxlength="100"></textarea>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@@ -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) {
|
function importCharacter(file) {
|
||||||
const ext = file.name.match(/\.(\w+)$/);
|
const ext = file.name.match(/\.(\w+)$/);
|
||||||
|
@@ -3999,6 +3999,13 @@ toolcool-color-picker {
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.prompt_overridden,
|
||||||
|
.jailbreak_overridden {
|
||||||
|
color: var(--SmartThemeQuoteColor);
|
||||||
|
font-weight: bold;
|
||||||
|
font-style: italic;
|
||||||
|
}
|
||||||
|
|
||||||
.openai_restorable .right_menu_button img {
|
.openai_restorable .right_menu_button img {
|
||||||
height: 20px;
|
height: 20px;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user