Generate a personalized reading report for a paper.
(
paper_ids: list[int] = typer.Argument(..., help="Paper IDs from a previous PaperFlow push."),
user_id: Optional[str] = typer.Option(None, "--user-id", "-u", help="Personalize the report for this user."),
push_id: Optional[str] = typer.Option(None, "--push-id", help="Read papers from a specific push ID."),
folder_id: Optional[str] = typer.Option(None, "--folder-id", help="Optional Feishu/Lark folder ID."),
no_feishu: bool = typer.Option(False, "--no-feishu", help="Do not send a Feishu/Lark notification."),
feishu_user_id: Optional[str] = typer.Option(None, "--feishu-user-id", help="Optional Feishu/Lark user open_id."),
)
| 180 | |
| 181 | @app.command() |
| 182 | def read( |
| 183 | paper_ids: list[int] = typer.Argument(..., help="Paper IDs from a previous PaperFlow push."), |
| 184 | user_id: Optional[str] = typer.Option(None, "--user-id", "-u", help="Personalize the report for this user."), |
| 185 | push_id: Optional[str] = typer.Option(None, "--push-id", help="Read papers from a specific push ID."), |
| 186 | folder_id: Optional[str] = typer.Option(None, "--folder-id", help="Optional Feishu/Lark folder ID."), |
| 187 | no_feishu: bool = typer.Option(False, "--no-feishu", help="Do not send a Feishu/Lark notification."), |
| 188 | feishu_user_id: Optional[str] = typer.Option(None, "--feishu-user-id", help="Optional Feishu/Lark user open_id."), |
| 189 | ) -> None: |
| 190 | """Generate a personalized reading report for a paper.""" |
| 191 | script = PROJECT_ROOT / "agents" / "reading-agent" / "main.py" |
| 192 | if not script.exists(): |
| 193 | typer.echo(f"[error] reading agent not found: {script}", err=True) |
| 194 | raise typer.Exit(code=1) |
| 195 | args: list[str] = ["--paper-ids", *[str(paper_id) for paper_id in paper_ids]] |
| 196 | if user_id: |
| 197 | args.extend(["--user-id", user_id]) |
| 198 | if push_id: |
| 199 | args.extend(["--push-id", push_id]) |
| 200 | if folder_id: |
| 201 | args.extend(["--folder-id", folder_id]) |
| 202 | if no_feishu: |
| 203 | args.append("--no-feishu") |
| 204 | if feishu_user_id: |
| 205 | args.extend(["--feishu-user-id", feishu_user_id]) |
| 206 | raise typer.Exit(code=_run_python(script, *args)) |
| 207 | |
| 208 | |
| 209 | @app.command() |
nothing calls this directly
no test coverage detected