diff --git a/public/script.js b/public/script.js index 877c932f5..e04a308f8 100644 --- a/public/script.js +++ b/public/script.js @@ -5295,14 +5295,13 @@ export function getBiasStrings(textareaText, type) { * @param {boolean} isInstruct Whether instruct mode is enabled. * @param {boolean|number} forceOutputSequence Whether to force the first/last output sequence for instruct mode. */ - function formatMessageHistoryItem(chatItem, isInstruct, forceOutputSequence) { const isNarratorType = chatItem?.extra?.type === system_message_types.NARRATOR; const characterName = chatItem?.name ? chatItem.name : name2; const itemName = chatItem.is_user ? chatItem['name'] : characterName; const shouldPrependName = !isNarratorType; - // If this flag is set, completely ignore the message. + // If this symbol flag is set, completely ignore the message. // This can be used to hide messages without affecting the number of messages in the chat. if (chatItem.extra?.[IGNORE_SYMBOL]) { return ''; diff --git a/public/scripts/constants.js b/public/scripts/constants.js index 5daa7b1bc..e1f632905 100644 --- a/public/scripts/constants.js +++ b/public/scripts/constants.js @@ -17,6 +17,7 @@ export const debounce_timeout = { /* Used as an ephemeral key in message extra metadata. -When set, the message will be excluded from context. +When set, the message will be excluded from generation prompts without affecting the number of chat messages, + which is needed to preserve world info timed effects. */ export const IGNORE_SYMBOL = Symbol.for('ignore'); diff --git a/public/scripts/openai.js b/public/scripts/openai.js index a8f7587a9..30efc6e03 100644 --- a/public/scripts/openai.js +++ b/public/scripts/openai.js @@ -528,7 +528,8 @@ function setOpenAIMessages(chat) { let role = chat[j]['is_user'] ? 'user' : 'assistant'; let content = chat[j]['mes']; - // If this flag is set, completely ignore the message + // If this flag is set, completely ignore the message. + // This can be used to hide messages without affecting the number of messages in the chat. if (chat[j].extra?.[IGNORE_SYMBOL]) { j++; continue;