Add prompt injection filters

This commit is contained in:
Cohee
2024-12-06 19:53:02 +02:00
parent 9c43999e4b
commit d6f34f7b2c
3 changed files with 86 additions and 40 deletions

View File

@@ -3721,7 +3721,7 @@ export async function checkWorldInfo(chat, maxContext, isDryRun) {
// Put this code here since otherwise, the chat reference is modified
for (const key of Object.keys(context.extensionPrompts)) {
if (context.extensionPrompts[key]?.scan) {
const prompt = getExtensionPromptByName(key);
const prompt = await getExtensionPromptByName(key);
if (prompt) {
buffer.addInject(prompt);
}