Compare commits

...

4 Commits

View File

@@ -161,11 +161,21 @@ class ResultDecorateStage(Stage):
# 不分段回复 # 不分段回复
new_chain.append(comp) new_chain.append(comp)
continue continue
split_response = re.findall( try:
self.regex, split_response = re.findall(
comp.text, self.regex,
re.DOTALL | re.MULTILINE, 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: if not split_response:
new_chain.append(comp) new_chain.append(comp)
continue continue