Create or update a user profile from text, PDFs, Scholar, or homepage data.
(
user_id: str = typer.Option(..., "--user-id", "-u", help="Create or update this PaperFlow user ID."),
natural_language: Optional[str] = typer.Option(
None,
"--natural-language",
"-d",
help="Free-form research-interest description.",
),
pdf: Optional[list[Path]] = typer.Option(
None,
"--pdf",
help="PDF used to bootstrap the profile. Repeat this option for multiple PDFs.",
),
scholar_url: Optional[str] = typer.Option(None, "--scholar-url", help="Google Scholar profile URL."),
homepage_url: Optional[str] = typer.Option(None, "--homepage-url", help="Research homepage URL."),
reset_existing: bool = typer.Option(False, "--reset-existing", help="Rebuild instead of merging into an existing profile."),
send_feishu: bool = typer.Option(False, "--send-feishu", help="Send the profile summary through Feishu/Lark."),
feishu_user_id: Optional[str] = typer.Option(None, "--feishu-user-id", help="Optional Feishu/Lark user open_id."),
chat_id: Optional[str] = typer.Option(None, "--chat-id", help="Optional Feishu/Lark chat ID."),
)
| 106 | |
| 107 | @app.command() |
| 108 | def profile( |
| 109 | user_id: str = typer.Option(..., "--user-id", "-u", help="Create or update this PaperFlow user ID."), |
| 110 | natural_language: Optional[str] = typer.Option( |
| 111 | None, |
| 112 | "--natural-language", |
| 113 | "-d", |
| 114 | help="Free-form research-interest description.", |
| 115 | ), |
| 116 | pdf: Optional[list[Path]] = typer.Option( |
| 117 | None, |
| 118 | "--pdf", |
| 119 | help="PDF used to bootstrap the profile. Repeat this option for multiple PDFs.", |
| 120 | ), |
| 121 | scholar_url: Optional[str] = typer.Option(None, "--scholar-url", help="Google Scholar profile URL."), |
| 122 | homepage_url: Optional[str] = typer.Option(None, "--homepage-url", help="Research homepage URL."), |
| 123 | reset_existing: bool = typer.Option(False, "--reset-existing", help="Rebuild instead of merging into an existing profile."), |
| 124 | send_feishu: bool = typer.Option(False, "--send-feishu", help="Send the profile summary through Feishu/Lark."), |
| 125 | feishu_user_id: Optional[str] = typer.Option(None, "--feishu-user-id", help="Optional Feishu/Lark user open_id."), |
| 126 | chat_id: Optional[str] = typer.Option(None, "--chat-id", help="Optional Feishu/Lark chat ID."), |
| 127 | ) -> None: |
| 128 | """Create or update a user profile from text, PDFs, Scholar, or homepage data.""" |
| 129 | script = PROJECT_ROOT / "agents" / "coldstart-agent" / "main.py" |
| 130 | if not script.exists(): |
| 131 | typer.echo(f"[error] cold-start agent not found: {script}", err=True) |
| 132 | raise typer.Exit(code=1) |
| 133 | args: list[str] = ["--user-id", user_id] |
| 134 | if natural_language: |
| 135 | args.extend(["--natural-language", natural_language]) |
| 136 | if pdf: |
| 137 | args.append("--pdf") |
| 138 | args.extend(str(path) for path in pdf) |
| 139 | if scholar_url: |
| 140 | args.extend(["--scholar-url", scholar_url]) |
| 141 | if homepage_url: |
| 142 | args.extend(["--homepage-url", homepage_url]) |
| 143 | if reset_existing: |
| 144 | args.append("--reset-existing") |
| 145 | if send_feishu: |
| 146 | args.append("--send-feishu") |
| 147 | if feishu_user_id: |
| 148 | args.extend(["--feishu-user-id", feishu_user_id]) |
| 149 | if chat_id: |
| 150 | args.extend(["--chat-id", chat_id]) |
| 151 | raise typer.Exit(code=_run_python(script, *args)) |
| 152 | |
| 153 | |
| 154 | @app.command() |
nothing calls this directly
no test coverage detected