diff --git a/public/script.js b/public/script.js index 7611c4340..a299f6fac 100644 --- a/public/script.js +++ b/public/script.js @@ -1339,11 +1339,13 @@ function cleanGroupMessage(getMessage) { } function getAllExtensionPrompts() { - return substituteParams(Object + const value = Object .values(extension_prompts) .filter(x => x.value) .map(x => x.value.trim()) - .join('\n')); + .join('\n'); + + return value.length ? substituteParams(value) : ''; } function getExtensionPrompt(position = 0, depth = undefined, separator = "\n") { @@ -1359,7 +1361,9 @@ function getExtensionPrompt(position = 0, depth = undefined, separator = "\n") { if (extension_prompt.length && !extension_prompt.endsWith(separator)) { extension_prompt = extension_prompt + separator; } - extension_prompt = substituteParams(extension_prompt); + if (extension_prompt.length) { + extension_prompt = substituteParams(extension_prompt); + } return extension_prompt; }