标记点完善

This commit is contained in:
小黑马 2025-03-20 15:26:33 +08:00
parent 4aefbe5aa8
commit 8c327f192c

View file

@ -266,7 +266,7 @@ class ConnectionHandler:
current_text = full_text[processed_chars:] # 从未处理的位置开始
# 查找最后一个有效标点
punctuations = ("。", "?", "!", ";", ":")
punctuations = ("。", "?", "!", ";", ":",",",",","~")
last_punct_pos = -1
for punct in punctuations:
pos = current_text.rfind(punct)
@ -382,7 +382,7 @@ class ConnectionHandler:
current_text = full_text[processed_chars:] # 从未处理的位置开始
# 查找最后一个有效标点
punctuations = ("。", "?", "!", ";", ":")
punctuations = ("。", "?", "!", ";", ":",",",",","~")
last_punct_pos = -1
for punct in punctuations:
pos = current_text.rfind(punct)
@ -589,4 +589,4 @@ class ConnectionHandler:
# After chat is complete, close the connection
self.close_after_chat = True
except Exception as e:
self.logger.bind(tag=TAG).error(f"Chat and close error: {str(e)}")
self.logger.bind(tag=TAG).error(f"Chat and close error: {str(e)}")