ngx-prompt-kit

Chat Stream

ngx-prompt-kit original — not part of ibelick/prompt-kit

readChatStream() reduces an SSE chat stream — tokens, tool calls/results, done/error — into handler callbacks and resolves with the terminal result. You supply an adapt() from your backend's payload shape, so it works over any tool-calling backend.

Examples

Reduce a stream

Runs readChatStream() over a simulated HttpClient event stream: tokens accumulate, tool calls/results are recorded, and the done payload resolves the promise.

Installation

readChatStream() ships with the streaming utility.

ng generate ngx-prompt-kit:streaming