1.7 KiB
1.7 KiB
飞书通知编排Skill 设计
1. Skill 定位
飞书通知编排Skill 是第七步工作流的总入口 Skill,负责组织飞书触发上下文解析、通知上下文加载、责任人映射、消息摘要生成、消息发送和回执记录。
英文实现标识建议使用 FeishuNotificationOrchestrateSkill。
2. 输入
@dataclass
class FeishuNotificationOrchestrateInput:
batch_id: int
scenario_id: str
trigger_source: str
feishu_chat_id: str
feishu_message_id: str | None = None
notify_owner: bool = True
include_web_link: bool = True
3. 输出
@dataclass
class FeishuNotificationOrchestrateOutput:
report_type: str
batch_id: int
send_status: str
mentioned_users: list[dict]
receipt: dict
audit_id: int | None = None
4. 依赖 Skill
飞书任务入口解析Skill飞书责任人映射Skill飞书消息摘要生成Skill飞书消息发送Skill飞书回执记录Skill
5. 核心方法
5.1 run(input) -> FeishuNotificationOrchestrateOutput
主入口方法。
5.2 load_notification_context(input) -> NotificationContext
加载风险报告、导出报告和 Web 链接。
5.3 build_notification_payload(context) -> dict
构建消息载荷。
6. 技术实现
使用技术:
- Tool Registry
- 飞书 OpenAPI / MCP
- Django ORM
- Audit 服务
7. 异常处理
- 风险报告缺失:发送提示消息。
- 飞书 chat_id 缺失:任务失败。
- 发送失败:记录失败回执。
8. 测试要点
- 能生成飞书通知报告。
- 能串联责任人映射和消息发送。
- 发送失败可记录审计。