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

Function _get_source_page_document

agents/reading-agent/main.py:1506–1514  ·  view source on GitHub ↗
(paper: Dict[str, Any])

Source from the content-addressed store, hash-verified

1504
1505def _get_source_page_document(paper: Dict[str, Any]) -> Optional[Dict[str, Any]]:
1506 metadata = paper.get("metadata") or {}
1507 source_page = metadata.get("source_page")
1508 normalized = _normalize_source_page_document(source_page)
1509 if normalized:
1510 if not normalized.get("abstract"):
1511 normalized["abstract"] = _clean_text(paper.get("abstract"))
1512 return normalized
1513 return None
1514
1515
1516def _backfill_metadata_from_source_page(paper: Dict[str, Any]) -> Dict[str, Any]:
1517 if _paper_has_sufficient_metadata_for_report(paper) and not paper.get("_prefer_detail_abstract"):

Callers 1

Calls 3

getMethod · 0.80
_clean_textFunction · 0.70

Tested by

no test coverage detected