mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-01-31 11:35:37 +01:00
Merge pull request #1057 from SillyTavern/fix-extension-depth
Fix extension depth
This commit is contained in:
commit
66bc15edc0
@ -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);
|
||||
}
|
||||
});
|
||||
|
@ -24,7 +24,6 @@ function createDefaultFiles() {
|
||||
}
|
||||
}
|
||||
|
||||
const process = require('process')
|
||||
const yargs = require('yargs/yargs');
|
||||
const { hideBin } = require('yargs/helpers');
|
||||
const net = require("net");
|
||||
@ -149,11 +148,8 @@ let api_openai = "https://api.openai.com/v1";
|
||||
let api_claude = "https://api.anthropic.com/v1";
|
||||
let main_api = "kobold";
|
||||
|
||||
let response_generate_novel;
|
||||
let characters = {};
|
||||
let response_dw_bg;
|
||||
let first_run = true;
|
||||
|
||||
|
||||
let color = {
|
||||
byNum: (mess, fgNum) => {
|
||||
@ -4134,7 +4130,7 @@ function backupSettings() {
|
||||
const backupFile = path.join(directories.backups, `settings_${generateTimestamp()}.json`);
|
||||
fs.copyFileSync(SETTINGS_FILE, backupFile);
|
||||
|
||||
let files = fs.readdirSync(directories.backups);
|
||||
let files = fs.readdirSync(directories.backups).filter(f => f.startsWith('settings_'));
|
||||
if (files.length > MAX_BACKUPS) {
|
||||
files = files.map(f => path.join(directories.backups, f));
|
||||
files.sort((a, b) => fs.statSync(a).mtimeMs - fs.statSync(b).mtimeMs);
|
||||
|
Loading…
x
Reference in New Issue
Block a user