Stabilize extension injections order for prompt manager

This commit is contained in:
Cohee
2023-08-25 17:15:55 +03:00
parent 94d2b737e2
commit 685e9b7e79

View File

@ -294,11 +294,11 @@ function setOpenAIMessages(chat) {
}
// Add chat injections, 100 = maximum depth of injection. (Why would you ever need more?)
for (let i = 0; i < 100; i++) {
for (let i = 100; i >= 0; i--) {
const anchor = getExtensionPrompt(extension_prompt_types.IN_CHAT, i);
if (anchor && anchor.length) {
openai_msgs.splice(i, 0, { "role": 'system', 'content': anchor.trim() })
openai_msgs.splice(i, 0, { "role": 'system', 'content': anchor.trim() });
}
}
}