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

Function _get_first_url

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

Source from the content-addressed store, hash-verified

943
944def _get_first_url(paper: Dict[str, Any], *keys: str) -> str:
945 metadata = paper.get("metadata")
946 if not isinstance(metadata, dict):
947 metadata = {}
948
949 for key in keys:
950 for container in (paper, metadata):
951 candidate = _clean_text(container.get(key))
952 if candidate.startswith("http://") or candidate.startswith("https://"):
953 return candidate
954 return ""
955
956
957def _get_direct_pdf_url(paper: Dict[str, Any]) -> str:
958 candidates = [

Calls 2

getMethod · 0.80
_clean_textFunction · 0.70

Tested by

no test coverage detected