MCPcopy Create free account
hub / github.com/OpenRaiser/PaperFlow / _generate_suggestions

Function _generate_suggestions

agents/profile-report-agent/main.py:379–404  ·  view source on GitHub ↗

生成画像调整建议 Args: report: 周报字典 Returns: 建议列表

(report: Dict)

Source from the content-addressed store, hash-verified

377
378def _generate_suggestions(report: Dict) -> List[str]:
379 """
380 生成画像调整建议
381
382 Args:
383 report: 周报字典
384
385 Returns:
386 建议列表
387 """
388 suggestions = []
389 direction_changes = report.get("direction_changes", [])
390
391 # 检测持续下降的方向
392 for change in direction_changes:
393 if change["trend"] == "down" and change["delta"] < -0.1:
394 direction_cn = translate_direction(change["direction"])
395 suggestions.append(f"{direction_cn}权重持续下降,是否还保留?")
396
397 # 检测新增方向
398 for change in direction_changes:
399 if change["previous_weight"] == 0 and change["current_weight"] > 0.3:
400 direction_cn = translate_direction(change["direction"])
401 suggestions.append(f"建议将\"{direction_cn}\"正式加入关注方向")
402
403 return suggestions
404
405
406def _build_drift_summary(profile: Dict[str, Any], drift_updates: List[Dict[str, Any]]) -> Dict[str, Any]:
407 """Aggregate current and recent drift signals for the weekly report."""

Callers 1

format_report_cardFunction · 0.85

Calls 2

getMethod · 0.80
translate_directionFunction · 0.70

Tested by

no test coverage detected