Constructors
constructor
- new JsonStreamParser(callbacks?): node.common.apis.cortex.JsonStreamParser
Parameters
Optionalcallbacks: JsonStreamParserCallbacks
Properties
hasCode
hasCode: boolean
hasResponse
hasResponse: boolean
Methods
feed
- feed(chunk): void
Returns void
finalize
- finalize(): JsonStreamParserResult
Returns JsonStreamParserResult
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.