feat(regulatory-info-package): 实现材料包生成工作流
This commit is contained in:
12
review_agent/regulatory_info_package/services/summary.py
Normal file
12
review_agent/regulatory_info_package/services/summary.py
Normal file
@@ -0,0 +1,12 @@
|
||||
from __future__ import annotations
|
||||
|
||||
|
||||
def build_assistant_summary(*, batch_no: str, exports: list[dict], failed_files: list[dict]) -> str:
|
||||
zip_exports = [item for item in exports if item.get("export_type") == "zip" or str(item.get("file_name", "")).endswith(".zip")]
|
||||
other_exports = [item for item in exports if item not in zip_exports]
|
||||
lines = [f"已完成第1章监管信息材料包生成,批次号:{batch_no}。", ""]
|
||||
for export in [*zip_exports, *other_exports]:
|
||||
lines.append(f"- [{export['file_name']}]({export['download_url']})")
|
||||
for failed in failed_files:
|
||||
lines.append(f"- {failed.get('file_name')}:生成失败,{failed.get('error_message') or '原因待查看'}")
|
||||
return "\n".join(lines)
|
||||
Reference in New Issue
Block a user