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

Function _loads_daily_note_classification_json

agents/reading-agent/main.py:2489–2501  ·  view source on GitHub ↗
(content: str)

Source from the content-addressed store, hash-verified

2487
2488def _loads_daily_note_classification_json(content: str) -> Dict[str, Any]:
2489 try:
2490 parsed = json.loads(content)
2491 return parsed if isinstance(parsed, dict) else {}
2492 except json.JSONDecodeError:
2493 pass
2494
2495 repaired = str(content or "")
2496 repaired = re.sub(r",\s*([}\]])", r"\1", repaired)
2497 repaired = re.sub(r"}\s*(?={)", "},", repaired)
2498 repaired = re.sub(r"}\s*\n\s*(?={)", "},\n", repaired)
2499 parsed = json.loads(repaired)
2500 return parsed if isinstance(parsed, dict) else {}
2501
2502
2503def _llm_daily_note_category_assignments(
2504 blocks: List[Dict[str, str]],

Calls

no outgoing calls

Tested by

no test coverage detected