mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Fix sequences to stop strings if missing values
This commit is contained in:
@ -243,12 +243,12 @@ export function getInstructStoppingSequences() {
|
||||
const result = [];
|
||||
|
||||
if (power_user.instruct.enabled) {
|
||||
const stop_sequence = power_user.instruct.stop_sequence;
|
||||
const input_sequence = power_user.instruct.input_sequence.replace(/{{name}}/gi, name1);
|
||||
const output_sequence = power_user.instruct.output_sequence.replace(/{{name}}/gi, name2);
|
||||
const first_output_sequence = power_user.instruct.first_output_sequence.replace(/{{name}}/gi, name2);
|
||||
const last_output_sequence = power_user.instruct.last_output_sequence.replace(/{{name}}/gi, name2);
|
||||
const system_sequence = power_user.instruct.system_sequence.replace(/{{name}}/gi, 'System');
|
||||
const stop_sequence = power_user.instruct.stop_sequence || '';
|
||||
const input_sequence = power_user.instruct.input_sequence?.replace(/{{name}}/gi, name1) || '';
|
||||
const output_sequence = power_user.instruct.output_sequence?.replace(/{{name}}/gi, name2) || '';
|
||||
const first_output_sequence = power_user.instruct.first_output_sequence?.replace(/{{name}}/gi, name2) || '';
|
||||
const last_output_sequence = power_user.instruct.last_output_sequence?.replace(/{{name}}/gi, name2) || '';
|
||||
const system_sequence = power_user.instruct.system_sequence?.replace(/{{name}}/gi, 'System') || '';
|
||||
|
||||
const combined_sequence = `${stop_sequence}\n${input_sequence}\n${output_sequence}\n${first_output_sequence}\n${last_output_sequence}\n${system_sequence}`;
|
||||
|
||||
|
Reference in New Issue
Block a user