格式化必读清单列表 Args: profile: 用户画像 Returns: 格式化文本
(profile: Dict)
| 352 | |
| 353 | |
| 354 | def format_must_read_list(profile: Dict) -> str: |
| 355 | """ |
| 356 | 格式化必读清单列表 |
| 357 | |
| 358 | Args: |
| 359 | profile: 用户画像 |
| 360 | |
| 361 | Returns: |
| 362 | 格式化文本 |
| 363 | """ |
| 364 | lines = [] |
| 365 | lines.append("=" * 60) |
| 366 | lines.append("📋 必读清单") |
| 367 | lines.append("=" * 60) |
| 368 | lines.append("") |
| 369 | |
| 370 | must_read = profile.get("must_read", {"authors": [], "institutions": [], "keywords": []}) |
| 371 | |
| 372 | # 作者 |
| 373 | authors = must_read.get("authors", []) |
| 374 | lines.append(f"━━━ 👥 作者 ({len(authors)}) ━━━") |
| 375 | if authors: |
| 376 | for author in authors: |
| 377 | lines.append(f" • {author}") |
| 378 | else: |
| 379 | lines.append(" (空,待添加)") |
| 380 | lines.append("") |
| 381 | |
| 382 | # 机构 |
| 383 | institutions = must_read.get("institutions", []) |
| 384 | lines.append(f"━━━ 🏛️ 机构 ({len(institutions)}) ━━━") |
| 385 | if institutions: |
| 386 | for inst in institutions: |
| 387 | lines.append(f" • {inst}") |
| 388 | else: |
| 389 | lines.append(" (空,待添加)") |
| 390 | lines.append("") |
| 391 | |
| 392 | # 关键词 |
| 393 | keywords = must_read.get("keywords", []) |
| 394 | lines.append(f"━━━ 🔑 关键词 ({len(keywords)}) ━━━") |
| 395 | if keywords: |
| 396 | for kw in keywords: |
| 397 | lines.append(f" • {kw}") |
| 398 | else: |
| 399 | lines.append(" (空,待添加)") |
| 400 | lines.append("") |
| 401 | |
| 402 | lines.append(COLD_START_MUST_READ_NOTE) |
| 403 | lines.append("") |
| 404 | lines.append("=" * 60) |
| 405 | lines.append("添加方式:") |
| 406 | lines.append(' "加个必读作者:Mohammed AlQuraishi"') |
| 407 | lines.append(' "添加必读机构:MIT"') |
| 408 | lines.append(' "添加必读关键词:GUI Agent"') |
| 409 | lines.append(CLEAR_READING_LIST_HINT) |
| 410 | lines.append("") |
| 411 | lines.append("移除方式:") |
no test coverage detected