From 963d9736c8024bd14da26477372887b9859b0b14 Mon Sep 17 00:00:00 2001 From: kwaroran Date: Sun, 26 May 2024 03:52:19 +0900 Subject: [PATCH] feat: enable regex for lorebook search --- src/lang/en.ts | 2 ++ src/lib/SideBars/LoreBook/LoreBookData.svelte | 10 ++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/lang/en.ts b/src/lang/en.ts index a248cdb7..686c2a07 100644 --- a/src/lang/en.ts +++ b/src/lang/en.ts @@ -125,6 +125,7 @@ export const languageEnglish = { dynamicAssets: "If enabled, if the asset name is not found when processing data, it will try to find the closest asset name by using vector search and replace it with the closest asset name.", dynamicAssetsEditDisplay: "If enabled, the dynamic assets will be applied to the Modify Display stage too. however, this can cause performance issues.", nickname: "Nickname would used be in {{char}} or in chat instead of character's name if it is set.", + useRegexLorebook: "If enabled, it will use regex for lorebook search, instead of string matching. it uses /regex/flags format.", }, setup: { chooseProvider: "Choose AI Provider", @@ -606,4 +607,5 @@ export const languageEnglish = { risupresetDesc: "Risupreset format is a format specifically designed for RisuAI presets.", jsonDesc: "JSON format is a format that is easy to read and write for both humans and machines.", nickname: "Nickname", + useRegexLorebook: "Use Regex" } \ No newline at end of file diff --git a/src/lib/SideBars/LoreBook/LoreBookData.svelte b/src/lib/SideBars/LoreBook/LoreBookData.svelte index 71f6bcac..db7fe2f3 100644 --- a/src/lib/SideBars/LoreBook/LoreBookData.svelte +++ b/src/lib/SideBars/LoreBook/LoreBookData.svelte @@ -56,7 +56,7 @@ {language.name} {#if !lorePlus} - {#if !value.alwaysActive} + {#if !value.alwaysActive && !value.useRegex} {language.activationKeys} {language.activationKeysInfo} @@ -95,12 +95,18 @@
- {#if !lorePlus} + {#if !lorePlus && !value.useRegex}
{/if} + {#if !lorePlus && !value.alwaysActive} +
+ + +
+ {/if} {#if !lorePlus}
{#if value.activationPercent === undefined || value.activationPercent === null}