From d87bfb0d5df6c4c3526a37cbfbd464c8ba5a5d19 Mon Sep 17 00:00:00 2001 From: Soulter <37870767+Soulter@users.noreply.github.com> Date: Thu, 12 Feb 2026 19:18:23 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96=E5=88=86=E6=AE=B5?= =?UTF-8?q?=E5=9B=9E=E5=A4=8D=E9=97=B4=E9=9A=94=E6=97=B6=E9=97=B4=E7=9A=84?= =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96=E9=80=BB=E8=BE=91=20(#5068)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fixes: #5059 --- astrbot/core/pipeline/respond/stage.py | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/astrbot/core/pipeline/respond/stage.py b/astrbot/core/pipeline/respond/stage.py index b57fed29e..b4a7ee7fa 100644 --- a/astrbot/core/pipeline/respond/stage.py +++ b/astrbot/core/pipeline/respond/stage.py @@ -61,16 +61,17 @@ class RespondStage(Stage): self.log_base = float( ctx.astrbot_config["platform_settings"]["segmented_reply"]["log_base"], ) - interval_str: str = ctx.astrbot_config["platform_settings"]["segmented_reply"][ - "interval" - ] - interval_str_ls = interval_str.replace(" ", "").split(",") - try: - self.interval = [float(t) for t in interval_str_ls] - except BaseException as e: - logger.error(f"解析分段回复的间隔时间失败。{e}") - self.interval = [1.5, 3.5] - logger.info(f"分段回复间隔时间:{self.interval}") + self.interval = [1.5, 3.5] + if self.enable_seg: + interval_str: str = ctx.astrbot_config["platform_settings"][ + "segmented_reply" + ]["interval"] + interval_str_ls = interval_str.replace(" ", "").split(",") + try: + self.interval = [float(t) for t in interval_str_ls] + except BaseException as e: + logger.error(f"解析分段回复的间隔时间失败。{e}") + logger.info(f"分段回复间隔时间:{self.interval}") async def _word_cnt(self, text: str) -> int: """分段回复 统计字数"""