优化文件生成

This commit is contained in:
liuwei
2025-05-30 16:26:31 +08:00
parent 570cfd38dd
commit de27ce4c66

View File

@@ -221,12 +221,8 @@ class MessageSummaryPlugin(MessagePluginInterface):
try:
# 使用唯一文件名并指定完整路径
timestamp = int(time.time())
output_filename = f"summary_{timestamp}.png"
output_dir = Path(os.path.dirname(os.path.abspath(__file__)), "outputs")
# 确保输出目录存在
os.makedirs(output_dir, exist_ok=True)
output_path = f"summary_{timestamp}.png"
# 构建完整的输出路径
output_path = os.path.join(output_dir, output_filename)
spath = await convert_md_str_to_image(answer, output_path)
self.LOG.info(f"成功生成图片: {spath}")
except Exception as e: