mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Replace getExtensionPromptMaxDepth with a constant
This commit is contained in:
@ -3051,10 +3051,13 @@ export async function getExtensionPromptByName(moduleName) {
|
|||||||
* @returns {number} Maximum depth of extension prompts
|
* @returns {number} Maximum depth of extension prompts
|
||||||
*/
|
*/
|
||||||
export function getExtensionPromptMaxDepth() {
|
export function getExtensionPromptMaxDepth() {
|
||||||
|
return MAX_INJECTION_DEPTH;
|
||||||
|
/*
|
||||||
const prompts = Object.values(extension_prompts);
|
const prompts = Object.values(extension_prompts);
|
||||||
const maxDepth = Math.max(...prompts.map(x => x.depth ?? 0));
|
const maxDepth = Math.max(...prompts.map(x => x.depth ?? 0));
|
||||||
// Clamp to 1 <= depth <= MAX_INJECTION_DEPTH
|
// Clamp to 1 <= depth <= MAX_INJECTION_DEPTH
|
||||||
return Math.max(Math.min(maxDepth, MAX_INJECTION_DEPTH), 1);
|
return Math.max(Math.min(maxDepth, MAX_INJECTION_DEPTH), 1);
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user