mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Fix extension prompts injects
This commit is contained in:
@ -765,7 +765,10 @@ async function populationInjectionPrompts(prompts, messages) {
|
|||||||
const wrap = false;
|
const wrap = false;
|
||||||
|
|
||||||
// Group prompts by priority
|
// Group prompts by priority
|
||||||
const orderGroups = {};
|
const extensionPromptsOrder = '0';
|
||||||
|
const orderGroups = {
|
||||||
|
[extensionPromptsOrder]: [],
|
||||||
|
};
|
||||||
for (const prompt of depthPrompts) {
|
for (const prompt of depthPrompts) {
|
||||||
const order = prompt.injection_order || 0;
|
const order = prompt.injection_order || 0;
|
||||||
if (!orderGroups[order]) {
|
if (!orderGroups[order]) {
|
||||||
@ -788,7 +791,9 @@ async function populationInjectionPrompts(prompts, messages) {
|
|||||||
.join(separator);
|
.join(separator);
|
||||||
|
|
||||||
// Get extension prompt
|
// Get extension prompt
|
||||||
const extensionPrompt = await getExtensionPrompt(extension_prompt_types.IN_CHAT, i, separator, roleTypes[role], wrap);
|
const extensionPrompt = order === extensionPromptsOrder
|
||||||
|
? await getExtensionPrompt(extension_prompt_types.IN_CHAT, i, separator, roleTypes[role], wrap)
|
||||||
|
: '';
|
||||||
const jointPrompt = [rolePrompts, extensionPrompt].filter(x => x).map(x => x.trim()).join(separator);
|
const jointPrompt = [rolePrompts, extensionPrompt].filter(x => x).map(x => x.trim()).join(separator);
|
||||||
|
|
||||||
if (jointPrompt && jointPrompt.length) {
|
if (jointPrompt && jointPrompt.length) {
|
||||||
|
Reference in New Issue
Block a user