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