diff --git a/public/script.js b/public/script.js index 73aefe7fb..941626660 100644 --- a/public/script.js +++ b/public/script.js @@ -5303,7 +5303,7 @@ function formatMessageHistoryItem(chatItem, isInstruct, forceOutputSequence) { // 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 (chatItem.ignore_formatting) { + if (chatItem.extra?.ignore) { return ''; } diff --git a/public/scripts/openai.js b/public/scripts/openai.js index 695db39a0..d2d4d978e 100644 --- a/public/scripts/openai.js +++ b/public/scripts/openai.js @@ -527,6 +527,12 @@ 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 (chat[j].extra?.ignore) { + j++; + continue; + } + // 100% legal way to send a message as system if (chat[j].extra?.type === system_message_types.NARRATOR) { role = 'system';