MCPcopy Create free account
hub / github.com/RASAAS/docmcp-knowledge / generate_report

Method generate_report

scripts/fetch_updates.py:2982–3012  ·  view source on GitHub ↗
(self, updates: list)

Source from the content-addressed store, hash-verified

2980 return updates
2981
2982 def generate_report(self, updates: list) -> dict:
2983 confirmed = [u for u in updates if u.get("confirmed_update")]
2984 db_confirmed = [u for u in updates if u.get("db_confirmed")]
2985 db_confirmed_new = len(db_confirmed)
2986 total_noise = sum(u.get("noise_filtered", 0) for u in updates)
2987 return {
2988 "checked_at": datetime.now().isoformat(),
2989 "updates_found": len(updates),
2990 "confirmed_updates": len(confirmed),
2991 "db_confirmed_new": db_confirmed_new,
2992 "noise_filtered_total": total_noise,
2993 "updates": updates,
2994 "db_stats": self.db_comparator.get_stats(),
2995 "summary": (
2996 f"{len(updates)} update(s) detected "
2997 f"({db_confirmed_new} DB-confirmed, {len(confirmed)} LLM-confirmed, "
2998 f"{total_noise} noise filtered) across "
2999 f"{len(set(u['category'] for u in updates))} categories"
3000 if updates else "No updates detected"
3001 ),
3002 "checkers_used": {
3003 "vertex_ai_search": False,
3004 "google_cse_legacy": False,
3005 "ec_page_scraper": True,
3006 "openfda_api": True,
3007 "llm_analysis": self.llm.available,
3008 "db_comparator": True,
3009 "ecfr_api": True,
3010 "eurlex_checker": True,
3011 },
3012 }
3013
3014
3015# ---------------------------------------------------------------------------

Callers 1

mainFunction · 0.95

Calls 2

getMethod · 0.80
get_statsMethod · 0.80

Tested by

no test coverage detected