From 6e13c0c87e490670b7af254f6e123118d5a7bbd2 Mon Sep 17 00:00:00 2001 From: HanishKVC Date: Tue, 14 May 2024 01:19:04 +0530 Subject: [PATCH] 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. --- common/chaton.hpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/common/chaton.hpp b/common/chaton.hpp index 3e69c5fda..3547881e4 100644 --- a/common/chaton.hpp +++ b/common/chaton.hpp @@ -578,10 +578,15 @@ inline bool chaton_tmpl_apply_ex( } cp.add_part(ChatParts::N, content); if (role == K_SYSTEM) { - if (chaton_tmpl_getkey_bool(tmpl, K_SYSTEMUSER_SYSTEM_HAS_SUFFIX)) { + if (cntSystem == 1) { + if (chaton_tmpl_getkey_bool(tmpl, K_SYSTEMUSER_SYSTEM_HAS_SUFFIX)) { + cp.add_part(ChatParts::S, suffix); + } + if (chaton_tmpl_getkey_bool(tmpl, K_SYSTEMUSER_SYSTEM_HAS_END)) { + cp.add_part(ChatParts::S, end); + } + } else { cp.add_part(ChatParts::S, suffix); - } - if (chaton_tmpl_getkey_bool(tmpl, K_SYSTEMUSER_SYSTEM_HAS_END)) { cp.add_part(ChatParts::S, end); } } else {