diff --git a/public/index.html b/public/index.html
index cd7afa5e3..94c4ea54c 100644
--- a/public/index.html
+++ b/public/index.html
@@ -4071,7 +4071,7 @@
Logic
diff --git a/public/scripts/world-info.js b/public/scripts/world-info.js
index aab4170c0..a64bf426e 100644
--- a/public/scripts/world-info.js
+++ b/public/scripts/world-info.js
@@ -36,7 +36,7 @@ const world_info_insertion_strategy = {
};
const world_info_logic = {
- AND: 0,
+ AND_ONE: 0,
NOT_ALL: 1,
NOT_ONE: 2,
};
@@ -849,7 +849,7 @@ function getWorldEntry(name, data, entry) {
const uid = $(this).data('uid');
const value = Number($(this).val());
console.debug(`logic for ${entry.uid} set to ${value}`);
- data.entries[uid].selectiveLogic = !isNaN(value) ? value : world_info_logic.AND;
+ data.entries[uid].selectiveLogic = !isNaN(value) ? value : world_info_logic.AND_ONE;
setOriginalDataValue(data, uid, 'selectiveLogic', data.entries[uid].selectiveLogic);
saveWorldInfo(name, data);
});
@@ -1371,7 +1371,7 @@ const newEntryTemplate = {
content: '',
constant: false,
selective: true,
- selectiveLogic: world_info_logic.AND,
+ selectiveLogic: world_info_logic.AND_ONE,
addMemo: false,
order: 100,
position: 0,
@@ -1791,11 +1791,11 @@ async function checkWorldInfo(chat, maxContext) {
hasAnyMatch = true;
}
- // Simplified AND ONE/NOT ONE (AND/NOR) if statement. (Proper fix for PR#1356 by Bronya)
+ // Simplified AND ONE / NOT ONE if statement. (Proper fix for PR#1356 by Bronya)
// If AND ONE logic and the main checks pass OR if NOT ONE logic and the main checks do not pass
- if ((selectiveLogic === world_info_logic.AND && hasSecondaryMatch) || (selectiveLogic === world_info_logic.NOT_ALL && !hasSecondaryMatch)) {
+ if ((selectiveLogic === world_info_logic.AND_ONE && hasSecondaryMatch) || (selectiveLogic === world_info_logic.NOT_ALL && !hasSecondaryMatch)) {
// Differ both logic statements in the debugger
- if (selectiveLogic === world_info_logic.AND) {
+ if (selectiveLogic === world_info_logic.AND_ONE) {
console.debug(`(AND ONE Check) Activating WI Entry ${entry.uid}. Found match for word: ${substituted} ${secondarySubstituted}`);
} else {
console.debug(`(NOT ONE Check) Activating WI Entry ${entry.uid}. Found match for word "${substituted}" without secondary keyword: ${secondarySubstituted}`);
@@ -1805,9 +1805,9 @@ async function checkWorldInfo(chat, maxContext) {
}
}
- // Handle NOT ALL (NOT AND) logic
+ // Handle NOT ALL logic
if (selectiveLogic === world_info_logic.NOT_ONE && !hasAnyMatch) {
- console.debug(`(NOT ALL Check) Activating WI Entry ${entry.uid}. Found match for word "${substituted}" without secondary keyword.`);
+ console.debug(`(NOT ALL Check) Activating WI Entry ${entry.uid}, no secondary keywords found.`);
activatedNow.add(entry);
}
@@ -1975,7 +1975,7 @@ function convertAgnaiMemoryBook(inputObj) {
content: entry.entry,
constant: false,
selective: false,
- selectiveLogic: world_info_logic.AND,
+ selectiveLogic: world_info_logic.AND_ONE,
order: entry.weight,
position: 0,
disable: !entry.enabled,
@@ -2003,7 +2003,7 @@ function convertRisuLorebook(inputObj) {
content: entry.content,
constant: entry.alwaysActive,
selective: entry.selective,
- selectiveLogic: world_info_logic.AND,
+ selectiveLogic: world_info_logic.AND_ONE,
order: entry.insertorder,
position: world_info_position.before,
disable: false,
@@ -2036,7 +2036,7 @@ function convertNovelLorebook(inputObj) {
content: entry.text,
constant: false,
selective: false,
- selectiveLogic: world_info_logic.AND,
+ selectiveLogic: world_info_logic.AND_ONE,
order: entry.contextConfig?.budgetPriority ?? 0,
position: 0,
disable: !entry.enabled,
@@ -2078,7 +2078,7 @@ function convertCharacterBook(characterBook) {
probability: entry.extensions?.probability ?? null,
useProbability: entry.extensions?.useProbability ?? false,
depth: entry.extensions?.depth ?? DEFAULT_DEPTH,
- selectiveLogic: entry.extensions?.selectiveLogic ?? world_info_logic.AND,
+ selectiveLogic: entry.extensions?.selectiveLogic ?? world_info_logic.AND_ONE,
group: entry.extensions?.group ?? '',
};
});