feat(reply): 引入统一格式过滤器,优化回复内容清理逻辑

This commit is contained in:
Windpicker-owo
2025-11-10 14:12:11 +08:00
parent 87f4b10959
commit 5d4ff6507a
3 changed files with 74 additions and 129 deletions

View File

@@ -482,7 +482,15 @@ class ProactiveThinkingPlanner:
return None
logger.info(f"生成回复成功: {response[:50]}...")
return response.strip()
# 应用格式过滤器,确保回复内容不包含系统格式化文本
from src.chat.utils.utils import filter_system_format_content
filtered_response = filter_system_format_content(response.strip())
if filtered_response != response.strip():
logger.debug(f"主动思考回复已过滤系统格式: '{response.strip()}' -> '{filtered_response}'")
return filtered_response
except Exception as e:
logger.error(f"生成回复失败: {e}", exc_info=True)