mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
made bias triggering stricter
{ } >>> {{ }}
This commit is contained in:
@ -784,7 +784,10 @@ function messageFormating(mes, ch_name, isSystem, forceAvatar) {
|
|||||||
.replace(/\n/g, "<br/>");
|
.replace(/\n/g, "<br/>");
|
||||||
} else if (!isSystem) {
|
} else if (!isSystem) {
|
||||||
mes = converter.makeHtml(mes);
|
mes = converter.makeHtml(mes);
|
||||||
mes = mes.replace(/{.*}/g, "");
|
//mes = mes.replace(/{.*}/g, "");
|
||||||
|
mes = mes.replace(/{{(\*?.+?\*?)}}/g, "");
|
||||||
|
|
||||||
|
|
||||||
mes = mes.replace(/\n/g, "<br/>");
|
mes = mes.replace(/\n/g, "<br/>");
|
||||||
mes = mes.trim();
|
mes = mes.trim();
|
||||||
|
|
||||||
@ -971,7 +974,8 @@ function extractMessageBias(message) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const found = [];
|
const found = [];
|
||||||
const rxp = /{([^}]+)}/g;
|
const rxp = /{{(\*?.+?\*?)}}/g;
|
||||||
|
//const rxp = /{([^}]+)}/g;
|
||||||
let curMatch;
|
let curMatch;
|
||||||
|
|
||||||
while ((curMatch = rxp.exec(message))) {
|
while ((curMatch = rxp.exec(message))) {
|
||||||
@ -1261,7 +1265,8 @@ async function Generate(type, automatic_trigger, force_name2) {//encode("dsfs").
|
|||||||
}
|
}
|
||||||
|
|
||||||
// replace bias markup
|
// replace bias markup
|
||||||
chat2[i] = (chat2[i] ?? '').replace(/{.*}/g, '');
|
//chat2[i] = (chat2[i] ?? '').replace(/{.*}/g, '');
|
||||||
|
chat2[i] = (chat2[i] ?? '').replace(/{{(\*?.+?\*?)}}/g, '');
|
||||||
//console.log('replacing chat2 {}s');
|
//console.log('replacing chat2 {}s');
|
||||||
j++;
|
j++;
|
||||||
}
|
}
|
||||||
|
@ -108,7 +108,8 @@ function setOpenAIMessages(chat) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// replace bias markup
|
// replace bias markup
|
||||||
content = (content ?? '').replace(/{.*}/g, '');
|
//content = (content ?? '').replace(/{.*}/g, '');
|
||||||
|
content = (content ?? '').replace(/{{(\*?.+?\*?)}}/g, '');
|
||||||
|
|
||||||
// Apply the "wrap in quotes" option
|
// Apply the "wrap in quotes" option
|
||||||
if (role == 'user' && oai_settings.wrap_in_quotes) content = `"${content}"`;
|
if (role == 'user' && oai_settings.wrap_in_quotes) content = `"${content}"`;
|
||||||
|
Reference in New Issue
Block a user