(
blocks: List[Dict[str, str]],
user_profile: Optional[Dict[str, Any]] = None,
)
| 2439 | |
| 2440 | def _daily_note_classification_payload( |
| 2441 | blocks: List[Dict[str, str]], |
| 2442 | user_profile: Optional[Dict[str, Any]] = None, |
| 2443 | ) -> str: |
| 2444 | papers = [ |
| 2445 | { |
| 2446 | "marker": block["marker"], |
| 2447 | "title": block["title"], |
| 2448 | "current_category": block["category"], |
| 2449 | "summary": block["summary"][:700], |
| 2450 | } |
| 2451 | for block in blocks |
| 2452 | ] |
| 2453 | return json.dumps( |
| 2454 | { |
| 2455 | "allowed_categories": DAILY_NOTE_CATEGORY_OPTIONS, |
| 2456 | "user_profile": _daily_note_profile_payload(user_profile), |
| 2457 | "papers": papers, |
| 2458 | }, |
| 2459 | ensure_ascii=False, |
| 2460 | ) |
| 2461 | |
| 2462 | |
| 2463 | def _parse_daily_note_classification_response(text: str, markers: set[str]) -> Dict[str, str]: |
| 2464 | content = str(text or "").strip() |
no test coverage detected