Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ce8b31b446 | ||
|
|
e2d0ce05d8 | ||
|
|
3e481e9947 | ||
|
|
1a257bf2cc |
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user