1. **Analyze the Request:** * Input: Unstructured text. * Output: Valid JSON matching a specific schema. * Schema: * `people`: Array of objects with `name` (str), `role` (str), `email` (str|null), `phone` (str|null), `mentioned_projects` (array of str). * `meetings`: Array of objects with `title` (str), `datetime_iso` (str), `attendees` (array of str). * Constraint: Return ONLY valid JSON, no markdown wrapping. 2. **Analyze the Text:** * "Hi team, Karen (CTO, karen@acme.io) wants to sync on Project Aurora and the Q3 migration next Tuesday at 2:30pm PT." * Person: Karen, Role: CTO, Email: karen@acme.io. * Meeting: Sync on Project Aurora and Q3 migration. Date/Time: Next Tuesday at 2:30pm PT. * Date calculation: Today is 2025-04-21 (Monday). Next Tuesday is 2025-04-29. Time: 2:30pm PT. PT is UTC-7 (PDT) or UTC-8 (PST). Let's use UTC-7 for April (PDT). 14:30 PDT = 21:30 UTC. ISO format: 2025-04-29T21:30:00Z. * Attendees: Karen, Dan Pham, Priya. * "Please include Dan Pham (eng lead, dan@acme.io, 415-555-0198) and Priya from product (priya.n@acme.io)." * Person: Dan Pham, Role: eng lead, Email: dan@acme.io, Phone: 415-555-0198. * Person: Priya, Role: product, Email: priya.n@acme.io. * "We'll also chat about Project Lumen with Karen." * Project: Project Lumen (mentioned for Karen). * "Separately, Friday 10am PST is the all-hands that Dan is running." * Meeting: All-hands. Date/Time: Friday 10am PST. * Date calculation: Today is 2025-04-21 (Monday). Friday is 2025-04-25. Time: 10am PST. PST is UTC-8. 10:00 PST = 18:00 UTC. ISO format: 2025-04-25T18:00:00Z. * Attendees: Dan (running it, so he's an attendee). 3. **Map to Schema:** * **People:** * Karen: name="Karen", role="CTO", email="karen@acme.io", phone=null, mentioned_projects=["Project Aurora", "Q3 migration", "Project Lumen"] * Dan Pham: name="Dan Pham", role="eng lead", email="dan@acme.io", phone="415-555-0198", mentioned_projects=["Project Aurora", "Q3 migration"] * Priya: name="Priya", role="product", email="priya.n@acme.io", phone=null, mentioned_projects=["Project Aurora", "Q3 migration"] * **Meetings:** * Meeting 1: title="Sync on Project Aurora and the Q3 migration", datetime_iso="2025-04-29T21:30:00Z", attendees=["Karen", "Dan Pham", "Priya"] * Meeting 2: title="all-hands", datetime_iso="2025-04-25T18:00:00Z", attendees=["Dan"] 4. **Refine Data Extraction & Formatting:** * *Date/Time Check:* * Today: 2025-04-21 (Monday) * Next Tuesday: 2025-04-29. 2:30pm PT. April is in PDT (UTC-7). 14:30 + 7 = 21:30 UTC. -> `2025-04-29T21:30:00Z` * Friday: 2025-04-25. 10am PST. April is in PDT (UTC-7). Wait, is it PST or PDT? The text says "PST". Even if it's technically PDT in April, I should convert based on the text's "PST" (UTC-8) or assume standard time conversion. Let's stick to the text's timezone label: PST = UTC-8. 10:00 + 8 = 18:00 UTC. -> `2025-04-25T18:00:00Z`. * *Project Mapping:* * "sync on Project Aurora and the Q3 migration" -> Projects: "Project Aurora", "Q3 migration". * "chat about Project Lumen with Karen" -> Project: "Project Lumen". * Dan and Priya are included in the sync, so they are mentioned in the context of "Project Aurora" and "Q3 migration". * *Attendees Mapping:* * Meeting 1: Karen (wants to sync), Dan Pham (include), Priya (include). * Meeting 2: Dan (running). 5. **Construct JSON:** ```json { "people": [ { "name": "Karen", "role": "CTO", "email": "karen@acme.io", "phone": null, "mentioned_projects": [ "Project Aurora", "Q3 migration", "Project Lumen" ] }, { "name": "Dan Pham", "role": "eng lead", "email": "dan@acme.io", "phone": "415-555-0198", "mentioned_projects": [ "Project Aurora", "Q3 migration" ] }, { "name": "Priya", "role": "product", "email": "priya.n@acme.io", "phone": null, "mentioned_projects": [ "Project Aurora", "Q3 migration" ] } ], "meetings": [ { "title": "Sync on Project Aurora and the Q3 migration", "datetime_iso": "2025-04-29T21:30:00Z", "attendees": [ "Karen", "Dan Pham", "Priya" ] }, { "title": "all-hands", "datetime_iso": "2025-04-25T18:00:00Z", "attendees": [ "Dan" ] } ] } ``` 6. **Final Review against Schema:** * `people` array of objects? Yes. * `name` (str)? Yes. * `role` (str)? Yes. * `email` (str|null)? Yes. * `phone` (str|null)? Yes. * `mentioned_projects` (array of str)? Yes. * `meetings` array of objects? Yes. * `title` (str)? Yes. * `datetime_iso` (str)? Yes. * `attendees` (array of str)? Yes. * No markdown wrapping? Yes. Let's double check the date/time logic. Today: 2025-04-21 (Monday) Next Tuesday: 2025-04-29. 2:30pm PT. PT usually means Pacific Time. In April, it's PDT (UTC-7). 14:30 + 7 = 21:30. `2025-04-29T21:30:00Z`. Friday: 2025-04-25. 10am PST. PST is UTC-8. 10:00 + 8 = 18:00. `2025-04-25T18:00:00Z`. Looks solid. One minor point: "Priya from product" -> role is "product". "Dan Pham (eng lead...)" -> role is "eng lead". "Karen (CTO...)" -> role is "CTO". "Dan is running" -> attendee is "Dan". Everything looks correct. Proceed to output. { "people": [ { "name": "Karen", "role": "CTO", "email": "karen@acme.io", "phone": null, "mentioned_projects": [ "Project Aurora", "Q3 migration", "Project Lumen" ] }, { "name": "Dan Pham", "role": "eng lead", "email": "dan@acme.io", "phone": "415-555-0198", "mentioned_projects": [ "Project Aurora", "Q3 migration" ] }, { "name": "Priya", "role": "product", "email": "priya.n@acme.io", "phone": null, "mentioned_projects": [ "Project Aurora", "Q3 migration" ] } ], "meetings": [ { "title": "Sync on Project Aurora and the Q3 migration", "datetime_iso": "2025-04-29T21:30:00Z", "attendees": [ "Karen", "Dan Pham", "Priya" ] }, { "title": "all-hands", "datetime_iso": "2025-04-25T18:00:00Z", "attendees": [ "Dan" ] } ] }