mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Add a main {{systemPrompt}} macro
This commit is contained in:
@ -518,13 +518,15 @@ function selectMatchingContextTemplate(name) {
|
||||
/**
|
||||
* Replaces instruct mode macros in the given input string.
|
||||
* @param {string} input Input string.
|
||||
* @param {Object<string, *>} env - Map of macro names to the values they'll be substituted with. If the param
|
||||
* @returns {string} String with macros replaced.
|
||||
*/
|
||||
export function replaceInstructMacros(input) {
|
||||
export function replaceInstructMacros(input, env) {
|
||||
if (!input) {
|
||||
return '';
|
||||
}
|
||||
const instructMacros = {
|
||||
'systemPrompt': (power_user.prefer_character_prompt && env.charPrompt ? env.charPrompt : power_user.instruct.system_prompt),
|
||||
'instructSystem|instructSystemPrompt': power_user.instruct.system_prompt,
|
||||
'instructSystemPromptPrefix': power_user.instruct.system_sequence_prefix,
|
||||
'instructSystemPromptSuffix': power_user.instruct.system_sequence_suffix,
|
||||
|
Reference in New Issue
Block a user