Compare commits

...

5 Commits

Author SHA1 Message Date
Soulter
ce8b31b446 fix: update error logging message for segmented reply regex handling 2025-11-24 20:02:22 +08:00
Soulter
e2d0ce05d8 fix: update regex handling in ResultDecorateStage to use findall for segmented replies 2025-11-24 20:01:49 +08:00
Soulter
3e481e9947 fix: improve regex handling for segmented replies to support multiline input 2025-11-24 20:00:27 +08:00
Soulter
1a257bf2cc fix: segmented reply regex error handling
closes: #3761
2025-11-24 19:59:13 +08:00
Soulter
3932b8f982 Merge pull request #3760 from AstrBotDevs/feat/agent-runner
refactor: transfer dify, coze and alibaba dashscope from chat provider to agent runner
2025-11-24 15:33:20 +08:00

View File

@@ -161,11 +161,21 @@ class ResultDecorateStage(Stage):
# 不分段回复
new_chain.append(comp)
continue
split_response = re.findall(
self.regex,
comp.text,
re.DOTALL | re.MULTILINE,
)
try:
split_response = re.findall(
self.regex,
comp.text,
re.DOTALL | re.MULTILINE,
)
except re.error:
logger.error(
f"分段回复正则表达式错误,使用默认分段方式: {traceback.format_exc()}",
)
split_response = re.findall(
r".*?[。?!~…]+|.+$",
comp.text,
re.DOTALL | re.MULTILINE,
)
if not split_response:
new_chain.append(comp)
continue