mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
World Info: Add scanning with AN
Add support for adding extension prompts into WI scanning. Doing this required adding a method to get extension prompts by name. Now, AN and depth prompts can be added to world info scanning. However, since scanning just looks for keys in the chatlog, append the extension prompts on the top of scanned text. Signed-off-by: kingbri <bdashore3@proton.me>
This commit is contained in:
@ -212,6 +212,7 @@ export {
|
||||
saveChat,
|
||||
messageFormatting,
|
||||
getExtensionPrompt,
|
||||
getExtensionPromptByName,
|
||||
showSwipeButtons,
|
||||
hideSwipeButtons,
|
||||
changeMainAPI,
|
||||
@ -2069,6 +2070,15 @@ function getAllExtensionPrompts() {
|
||||
return value.length ? substituteParams(value) : '';
|
||||
}
|
||||
|
||||
// Wrapper to fetch extension prompts by module name
|
||||
function getExtensionPromptByName(moduleName) {
|
||||
if (moduleName) {
|
||||
return substituteParams(extension_prompts[moduleName]?.value);
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
function getExtensionPrompt(position = 0, depth = undefined, separator = "\n") {
|
||||
let extension_prompt = Object.keys(extension_prompts)
|
||||
.sort()
|
||||
|
Reference in New Issue
Block a user