adding comments

dac5f6910c9a4e3fda00dcac856b229deff3cba4

qvink <qvink@users.noreply.github.com>

3 files changed, +5 -4Showing whitespace changes
public/script.js+1 -2
@@ -5295,14 +5295,13 @@ export function getBiasStrings(textareaText, type) {
5295 * @param {boolean} isInstruct Whether instruct mode is enabled.5295 * @param {boolean} isInstruct Whether instruct mode is enabled.
5296 * @param {boolean|number} forceOutputSequence Whether to force the first/last output sequence for instruct mode.5296 * @param {boolean|number} forceOutputSequence Whether to force the first/last output sequence for instruct mode.
5297 */5297 */
5298
5299function formatMessageHistoryItem(chatItem, isInstruct, forceOutputSequence) {5298function formatMessageHistoryItem(chatItem, isInstruct, forceOutputSequence) {
5300 const isNarratorType = chatItem?.extra?.type === system_message_types.NARRATOR;5299 const isNarratorType = chatItem?.extra?.type === system_message_types.NARRATOR;
5301 const characterName = chatItem?.name ? chatItem.name : name2;5300 const characterName = chatItem?.name ? chatItem.name : name2;
5302 const itemName = chatItem.is_user ? chatItem['name'] : characterName;5301 const itemName = chatItem.is_user ? chatItem['name'] : characterName;
5303 const shouldPrependName = !isNarratorType;5302 const shouldPrependName = !isNarratorType;
53045303
5305 // If this flag is set, completely ignore the message.5304 // If this symbol flag is set, completely ignore the message.
5306 // This can be used to hide messages without affecting the number of messages in the chat.5305 // This can be used to hide messages without affecting the number of messages in the chat.
5307 if (chatItem.extra?.[IGNORE_SYMBOL]) {5306 if (chatItem.extra?.[IGNORE_SYMBOL]) {
5308 return '';5307 return '';
public/scripts/constants.js+2 -1
@@ -17,6 +17,7 @@ export const debounce_timeout = {
1717
18/*18/*
19Used as an ephemeral key in message extra metadata.19Used as an ephemeral key in message extra metadata.
20When set, the message will be excluded from context.20When set, the message will be excluded from generation prompts without affecting the number of chat messages,
21 which is needed to preserve world info timed effects.
21 */22 */
22export const IGNORE_SYMBOL = Symbol.for('ignore');23export const IGNORE_SYMBOL = Symbol.for('ignore');
public/scripts/openai.js+2 -1
@@ -528,7 +528,8 @@ function setOpenAIMessages(chat) {
528 let role = chat[j]['is_user'] ? 'user' : 'assistant';528 let role = chat[j]['is_user'] ? 'user' : 'assistant';
529 let content = chat[j]['mes'];529 let content = chat[j]['mes'];
530530
531 // If this flag is set, completely ignore the message531 // If this flag is set, completely ignore the message.
532 // This can be used to hide messages without affecting the number of messages in the chat.
532 if (chat[j].extra?.[IGNORE_SYMBOL]) {533 if (chat[j].extra?.[IGNORE_SYMBOL]) {
533 j++;534 j++;
534 continue;535 continue;