Merge pull request #1053 from SillyTavern/fix-extension-depth

This commit is contained in:
Cohee 2023-08-30 10:18:03 +03:00 committed by GitHub
commit 189cbcc58e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2801,11 +2801,11 @@ async function Generate(type, { automatic_trigger, force_name2, resolve, reject,
return;
}
const anchorDepth = Math.abs(index - finalMesSend.length + 1);
const anchorDepth = Math.abs(index - finalMesSend.length);
// NOTE: Depth injected here!
const extensionAnchor = getExtensionPrompt(extension_prompt_types.IN_CHAT, anchorDepth);
if (anchorDepth > 0 && extensionAnchor && extensionAnchor.length) {
if (anchorDepth >= 0 && extensionAnchor && extensionAnchor.length) {
mesItem.extensionPrompts.push(extensionAnchor);
}
});