(
*,
user_id: str,
question: str,
resolved_nodes: List[Dict[str, Any]],
limit: int,
scope: str = "all",
)
| 4370 | "category": category, |
| 4371 | "source": "recent_daily_push", |
| 4372 | }, |
| 4373 | "score": _to_float(score, 1.0), |
| 4374 | "updated_at": paper.get("pushed_at") or paper.get("updated_at") or "", |
| 4375 | } |
| 4376 | ) |
| 4377 | if len(nodes) >= max(1, int(limit or 8)): |
| 4378 | break |
| 4379 | return nodes |
| 4380 | |
| 4381 | |
| 4382 | def _chat_pinned_nodes( |
| 4383 | *, |
| 4384 | user_id: str, |
| 4385 | question: str, |
| 4386 | resolved_nodes: List[Dict[str, Any]], |
| 4387 | limit: int, |
| 4388 | scope: str = "all", |
| 4389 | ) -> List[Dict[str, Any]]: |
| 4390 | pinned = list(resolved_nodes or []) |
| 4391 | if _should_pin_recent_papers(question, scope) or pinned: |
| 4392 | seen = {str(node.get("node_id") or "") for node in pinned} |
| 4393 | remaining = max(0, int(limit or 8) - len(pinned)) |
| 4394 | query = question if _local_paper_query_tokens(question) else "" |
no test coverage detected