mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Spec v2: {{original}} macro for prompt overrides.
This commit is contained in:
@@ -1377,13 +1377,20 @@ function scrollChatToBottom() {
|
||||
}
|
||||
}
|
||||
|
||||
function substituteParams(content, _name1, _name2) {
|
||||
function substituteParams(content, _name1, _name2, _original) {
|
||||
_name1 = _name1 ?? name1;
|
||||
_name2 = _name2 ?? name2;
|
||||
if (!content) {
|
||||
return ''
|
||||
}
|
||||
|
||||
// Replace {{original}} with the original message
|
||||
// Note: only replace the first instance of {{original}}
|
||||
// This will hopefully prevent the abuse
|
||||
if (_original) {
|
||||
content = content.replace(/{{original}}/i, _original);
|
||||
}
|
||||
|
||||
content = content.replace(/{{user}}/gi, _name1);
|
||||
content = content.replace(/{{char}}/gi, _name2);
|
||||
content = content.replace(/<USER>/gi, _name1);
|
||||
|
Reference in New Issue
Block a user