Character-by-character state machine for parsing streamed JSON.
Expects JSON matching the cortex_output schema: { "response": "...", "code": "...", "thoughts": "..." }
Fires callbacks as content is extracted from response/thoughts fields. Batches response text and flushes on sentence-ending punctuation for TTS.
Feed a chunk of streamed JSON text into the parser.
Finalize parsing and return accumulated field values.
Character-by-character state machine for parsing streamed JSON.
Expects JSON matching the cortex_output schema: { "response": "...", "code": "...", "thoughts": "..." }
Fires callbacks as content is extracted from response/thoughts fields. Batches response text and flushes on sentence-ending punctuation for TTS.