(
*,
user_id: str,
push_id: str,
selected_numbers: Iterable[Any],
skipped_numbers: Iterable[Any],
later_numbers: Iterable[Any] = (),
generate_reports: bool = True,
write_feishu: Optional[bool] = None,
response_language: str = "zh",
)
| 3038 | _READING_TASKS[task_id] = task |
| 3039 | _prune_task_registry(_READING_TASKS) |
| 3040 | thread.start() |
| 3041 | return {"task": _reading_task_payload(task), "created_docs": task["created_docs"], "count": len(docs)} |
| 3042 | |
| 3043 | |
| 3044 | def get_reading_reports_task(task_id: str) -> Dict[str, Any]: |
| 3045 | with _READING_TASK_LOCK: |
| 3046 | return {"task": _reading_task_payload(_READING_TASKS.get(str(task_id or "").strip()))} |
| 3047 | |
| 3048 | |
| 3049 | def _doc_payloads(docs: Iterable[Dict[str, Any]]) -> List[Dict[str, Any]]: |
| 3050 | return [ |
| 3051 | { |
| 3052 | "title": doc.get("title"), |
| 3053 | "url": doc.get("url"), |
| 3054 | "doc_token": doc.get("doc_token"), |
| 3055 | "report_path": doc.get("report_path"), |
| 3056 | "report_id": ( |
| 3057 | _report_id( |
| 3058 | Path(doc["report_path"]) |
| 3059 | if Path(doc["report_path"]).is_absolute() |
| 3060 | else (PROJECT_ROOT / str(doc["report_path"])) |
| 3061 | ) |
| 3062 | if doc.get("report_path") |
| 3063 | else "" |
| 3064 | ), |
| 3065 | "pdf_path": doc.get("pdf_path"), |
| 3066 | "paper": _paper_card(doc.get("paper") or {}, index + 1), |
| 3067 | "reused": bool(doc.get("reused")), |
| 3068 | "feishu_error": doc.get("feishu_error"), |
| 3069 | } |
| 3070 | for index, doc in enumerate(docs or []) |
| 3071 | ] |
| 3072 |
nothing calls this directly
no test coverage detected