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

Function cold_start

agents/coldstart-agent/main.py:1732–1869  ·  view source on GitHub ↗

Execute the cold-start / PDF-update flow.

(
    user_id: str = "user_001",
    natural_language: Optional[str] = None,
    pdf_paths: Optional[List[str]] = None,
    scholar_url: Optional[str] = None,
    homepage_url: Optional[str] = None,
    reset_existing: bool = False,
    send_to_feishu: bool = True,
    feishu_user_id: Optional[str] = None,
    chat_id: Optional[str] = None,
)

Source from the content-addressed store, hash-verified

1730 systematic_pref = method_prefs.get("preference_systematic_work_over_incremental")
1731 if systematic_pref is True:
1732 lines.append("├── 偏好系统性工作 > 单点改进")
1733 elif systematic_pref is False:
1734 lines.append("├── 偏好单点改进 > 系统性工作")
1735 else:
1736 lines.append("├── 系统性工作 / 单点改进:暂无明确信号")
1737
1738 lines.append(
1739 "├── 偏好有开源代码的工作"
1740 if method_prefs.get("preference_open_source_code")
1741 else "├── 对开源代码暂无明显偏好"
1742 )
1743 lines.append(
1744 "└── 偏好有生物/科学应用场景的工作"
1745 if method_prefs.get("preference_bio_science_application")
1746 else "└── 通用研究场景均可"
1747 )
1748 else:
1749 lines.append("(暂无方法论偏好信号)")
1750
1751 must_read = profile.get("must_read", {"authors": [], "institutions": [], "keywords": []}) or {}
1752 lines.extend(
1753 [
1754 "",
1755 "━━━ 必读清单 ━━━",
1756 f"作者:{', '.join(must_read.get('authors', [])) or '(空,待你添加)'}",
1757 f"机构:{', '.join(must_read.get('institutions', [])) or '(空,待你添加)'}",
1758 f"关键词:{', '.join(must_read.get('keywords', [])) or '(空,待你添加)'}",
1759 COLD_START_MUST_READ_NOTE,
1760 "",
1761 "━━━━━━━━━━━━",
1762 "你可以直接说:",
1763 ' "加个必读作者:XXX"',
1764 CLEAR_READING_LIST_HINT,
1765 ' "降低 GUI Agent 权重"',
1766 ' "我最近对 protein language model 更感兴趣了"',
1767 ]
1768 )
1769
1770 return "\n".join(lines)
1771
1772
1773def translate_direction(direction: str) -> str:
1774 """Translate internal direction keys into display labels."""
1775 try:
1776 direction_lexicon = importlib.import_module("config.direction_lexicon")
1777 formatter = getattr(direction_lexicon, "format_direction_label", None)
1778 if callable(formatter):
1779 return str(formatter(direction, prefer_chinese=True) or direction)
1780 except Exception:
1781 pass
1782 return direction
1783
1784
1785def cold_start(
1786 user_id: str = "user_001",
1787 natural_language: Optional[str] = None,
1788 pdf_paths: Optional[List[str]] = None,
1789 scholar_url: Optional[str] = None,

Callers 1

main.pyFile · 0.85

Calls 15

ensure_profile_shapeFunction · 0.85
parse_natural_languageFunction · 0.85
parse_research_homepageFunction · 0.85
generate_interest_vectorFunction · 0.85
update_profileFunction · 0.85
create_profileFunction · 0.85

Tested by

no test coverage detected