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