Fix instruct name formatting for groups

This commit is contained in:
SillyLossy
2023-05-13 00:57:55 +03:00
parent bfaf8e6aa1
commit 4264bebe13

View File

@ -624,10 +624,10 @@ function loadInstructMode() {
}
export function formatInstructModeChat(name, mes, isUser) {
const includeNames = power_user.instruct.names || (selected_group && !isUser);
const includeNames = power_user.instruct.names || !!selected_group;
const sequence = isUser ? power_user.instruct.input_sequence : power_user.instruct.output_sequence;
const separator = power_user.instruct.wrap ? '\n' : '';
const textArray = includeNames ? [sequence, name, ': ', mes, separator] : [sequence, mes, separator];
const textArray = includeNames ? [sequence, `${name}: ${mes}`, separator] : [sequence, mes, separator];
const text = textArray.filter(x => x).join(separator);
return text;
}