From f1a448708c02e5dafa1fdc8f642c89e65ae94c23 Mon Sep 17 00:00:00 2001 From: Soulter <905617992@qq.com> Date: Fri, 14 Feb 2025 16:19:09 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix:=20segmented=20reply=20cause?= =?UTF-8?q?d=20incomplete=20non-llm-response=20#503?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- astrbot/core/pipeline/result_decorate/stage.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/astrbot/core/pipeline/result_decorate/stage.py b/astrbot/core/pipeline/result_decorate/stage.py index b2bdd53ae..8c21fb376 100644 --- a/astrbot/core/pipeline/result_decorate/stage.py +++ b/astrbot/core/pipeline/result_decorate/stage.py @@ -82,7 +82,9 @@ class ResultDecorateStage(Stage): # 不分段回复 new_chain.append(comp) continue - split_response = re.findall(self.regex, comp.text) + split_response = [] + for line in comp.text.split("\n"): + split_response.extend(re.findall(self.regex, line)) if not split_response: new_chain.append(comp) continue