mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-03-13 10:30:14 +01:00
Fix sequences to stop strings if missing values
This commit is contained in:
parent
c0fffde739
commit
422b9e1b63
@ -243,12 +243,12 @@ export function getInstructStoppingSequences() {
|
|||||||
const result = [];
|
const result = [];
|
||||||
|
|
||||||
if (power_user.instruct.enabled) {
|
if (power_user.instruct.enabled) {
|
||||||
const stop_sequence = power_user.instruct.stop_sequence;
|
const stop_sequence = power_user.instruct.stop_sequence || '';
|
||||||
const input_sequence = power_user.instruct.input_sequence.replace(/{{name}}/gi, name1);
|
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 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 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 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 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}`;
|
const combined_sequence = `${stop_sequence}\n${input_sequence}\n${output_sequence}\n${first_output_sequence}\n${last_output_sequence}\n${system_sequence}`;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user