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

Function _collect_evidence_sections

agents/reading-agent/main.py:3284–3291  ·  view source on GitHub ↗
(evidence: Dict[str, Any], bucket: str, *, limit: int = 3)

Source from the content-addressed store, hash-verified

3282
3283
3284def _collect_evidence_sections(evidence: Dict[str, Any], bucket: str, *, limit: int = 3) -> List[str]:
3285 matches = ((evidence or {}).get("matches") or {}).get(bucket) or []
3286 labels = [
3287 _format_pdf_section_label(match.get("section", ""))
3288 for match in matches
3289 if _clean_text(match.get("section"))
3290 ]
3291 return _unique_preserve_order(labels)[:limit]
3292
3293
3294def _format_evidence_anchor(match: Dict[str, Any]) -> str:

Callers 1

Calls 4

_unique_preserve_orderFunction · 0.85
getMethod · 0.80
_clean_textFunction · 0.70

Tested by

no test coverage detected