ChatON:Control SystemMsgSuffix+End tags only wrt 1st system msg

Make it similar to user-begin+prefix control. ie only wrt 1st msg
of respective type.
This commit is contained in:
HanishKVC 2024-05-14 01:19:04 +05:30
parent 3fcaf19967
commit 6e13c0c87e

View file

@ -578,6 +578,7 @@ inline bool chaton_tmpl_apply_ex(
}
cp.add_part(ChatParts::N, content);
if (role == K_SYSTEM) {
if (cntSystem == 1) {
if (chaton_tmpl_getkey_bool(tmpl, K_SYSTEMUSER_SYSTEM_HAS_SUFFIX)) {
cp.add_part(ChatParts::S, suffix);
}
@ -588,6 +589,10 @@ inline bool chaton_tmpl_apply_ex(
cp.add_part(ChatParts::S, suffix);
cp.add_part(ChatParts::S, end);
}
} else {
cp.add_part(ChatParts::S, suffix);
cp.add_part(ChatParts::S, end);
}
}
if (alertAssistantAtEnd) {
auto assistantBeginPrefix = chaton_tmpl_role_getkeys(tmpl, K_ASSISTANT, {K_BEGIN, K_PREFIX});