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

Function _valid_url

agents/reading-agent/main.py:460–464  ·  view source on GitHub ↗
(candidate: Any)

Source from the content-addressed store, hash-verified

458
459 def _valid_url(candidate: Any) -> Optional[str]:
460 text = str(candidate or "").strip()
461 if text.startswith("http://") or text.startswith("https://"):
462 return text
463 return None
464
465 for candidate in (doc_info.get("url"), doc_info.get("doc_url"), doc_info.get("link")):
466 valid = _valid_url(candidate)
467 if valid:

Callers 1

extract_doc_urlFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected