ML — Streaming API
Slice 2 ML.
Slice 2: ML — Streaming Session API + NDJSON Routing
Owner: ML engineer Domain: ML Complexity: L
Introduces the resource-oriented streaming session API and the NDJSON event stream that Core consumes.
Tasks
- Implement
POST /streaming/sessions— response body remains open asapplication/x-ndjson - Implement
POST /streaming/sessions/{id}/audio— audio chunk delivery - Implement
DELETE /streaming/sessions/{id}— clean session termination with AssemblyAI buffer drain - Add NDJSON event types:
transcript_segment,feature_vector,speaker_match,talking_point,task - Implement speaker identification logic and task extraction (~60s cadence)
- Extend post-meeting pipeline to honour
skip_tasksflag - Regenerate API spec:
./dev gen all
Test cases:
| Test | Location | Assertion |
|---|---|---|
| Session lifecycle works end-to-end | test_ml | Create → audio → events stream → delete completes without error |
| All 5 NDJSON event types emitted | test_ml | Each event type appears in the stream with correct envelope |
skip_tasks=true preserves live tasks | test_ml | Post-meeting pipeline does not call task extraction |
| Session conflict returns 409 | test_ml | Second POST /streaming/sessions for same meeting → 409 |