From 9f41f495785c73d716872a22c0da442236e2d298 Mon Sep 17 00:00:00 2001 From: Windpicker-owo <3431391539@qq.com> Date: Tue, 16 Dec 2025 15:56:31 +0800 Subject: [PATCH] =?UTF-8?q?fix(utils):=20=E4=BF=AE=E5=A4=8D=E6=AD=A3?= =?UTF-8?q?=E5=88=99=E8=A1=A8=E8=BE=BE=E5=BC=8F=E4=BB=A5=E6=AD=A3=E7=A1=AE?= =?UTF-8?q?=E6=8F=90=E5=8F=96=E5=8C=85=E5=90=AB=E4=B8=AD=E6=96=87=E7=9A=84?= =?UTF-8?q?=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/chat/utils/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chat/utils/utils.py b/src/chat/utils/utils.py index 326271471..7487c6478 100644 --- a/src/chat/utils/utils.py +++ b/src/chat/utils/utils.py @@ -428,7 +428,7 @@ def process_llm_response(text: str, enable_splitter: bool = True, enable_chinese protected_text, special_blocks_mapping = protect_special_blocks(protected_text) # 提取被 () 或 [] 或 ()包裹且包含中文的内容 - pattern = re.compile(r"[(\[(](?=.*[一-鿿]).*?[)\])]") + pattern = re.compile(r"[(\[(](?=.*[一-鿿]).+?[)\])]") _extracted_contents = pattern.findall(protected_text) cleaned_text = pattern.sub("", protected_text)