Format a short confirmation prompt for pending canonical directions.
(pending_candidates: List[Dict[str, Any]])
| 726 | |
| 727 | |
| 728 | def format_pending_direction_prompt(pending_candidates: List[Dict[str, Any]]) -> str: |
| 729 | """Format a short confirmation prompt for pending canonical directions.""" |
| 730 | if not pending_candidates: |
| 731 | return "" |
| 732 | if len(pending_candidates) == 1: |
| 733 | candidate = pending_candidates[0] |
| 734 | label = candidate.get("name_cn") or candidate.get("name") or candidate.get("candidate_key") |
| 735 | return f"发现候选新方向:{label},回复“确认方向:{label}”后纳入统一方向库。" |
| 736 | |
| 737 | lines = ["发现候选新方向,请任选其一确认:"] |
| 738 | for candidate in pending_candidates[:3]: |
| 739 | label = candidate.get("name_cn") or candidate.get("name") or candidate.get("candidate_key") |
| 740 | lines.append(f"- {label}:回复“确认方向:{label}”") |
| 741 | return "\n".join(lines) |
| 742 | |
| 743 | |
| 744 | def merge_unique_message_sections(*sections: Any) -> str: |
no test coverage detected