72 lines
1.4 KiB
Markdown
72 lines
1.4 KiB
Markdown
# 整改建议生成Skill 设计
|
|
|
|
## 1. Skill 定位
|
|
|
|
`整改建议生成Skill` 负责根据风险项生成处理建议、整改优先级和责任角色。
|
|
|
|
英文实现标识建议使用 `RectificationSuggestionBuildSkill`。
|
|
|
|
## 2. 输入
|
|
|
|
```python
|
|
@dataclass
|
|
class RectificationSuggestionBuildInput:
|
|
risk_items: list[RiskItem]
|
|
suggestion_templates: dict
|
|
owner_role_mapping: dict
|
|
enable_llm_summary: bool = True
|
|
```
|
|
|
|
## 3. 输出
|
|
|
|
```python
|
|
@dataclass
|
|
class RectificationSuggestionBuildOutput:
|
|
suggestions: list[dict]
|
|
owner_notifications: list[dict]
|
|
summary_text: str
|
|
```
|
|
|
|
## 4. 核心方法
|
|
|
|
### 4.1 `run(input) -> RectificationSuggestionBuildOutput`
|
|
|
|
主入口方法。
|
|
|
|
### 4.2 `build_suggestion(risk_item) -> dict`
|
|
|
|
生成单项建议。
|
|
|
|
### 4.3 `resolve_owner_role(risk_item) -> str`
|
|
|
|
映射责任角色。
|
|
|
|
### 4.4 `sort_by_priority(suggestions) -> list[dict]`
|
|
|
|
按风险等级和业务优先级排序。
|
|
|
|
### 4.5 `build_summary_text(suggestions) -> str`
|
|
|
|
生成摘要,可选使用 LLM Provider。
|
|
|
|
## 5. 技术实现
|
|
|
|
使用技术:
|
|
|
|
1. 建议模板
|
|
2. 责任角色映射
|
|
3. 可选 LLM Provider
|
|
|
|
## 6. 异常处理
|
|
|
|
1. 模板缺失:使用默认建议。
|
|
2. 责任角色缺失:使用默认负责人。
|
|
3. LLM 不可用:使用本地摘要。
|
|
|
|
## 7. 测试要点
|
|
|
|
1. 高风险建议优先。
|
|
2. 责任角色映射正确。
|
|
3. LLM 不可用时本地摘要可用。
|
|
|