diff --git a/main/xiaozhi-server/core/connection.py b/main/xiaozhi-server/core/connection.py index 718398c3d..4e2cbd033 100644 --- a/main/xiaozhi-server/core/connection.py +++ b/main/xiaozhi-server/core/connection.py @@ -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)}") \ No newline at end of file