stream_reveal_text
Detokenize LLM SSE and stdio stream chunks in real time, buffering split token candidates across boundaries to prevent corrupted characters or tokens; use flush on the final chunk.
Instructions
STEP 3 (Streaming): Real-time streaming token detokenizer for LLM Server-Sent Events (SSE) and stdio chunk pipelines. Buffers split token candidates across chunk boundaries (e.g. '[EM' + 'AIL_1]') so no characters or tokens are corrupted. Pass 'flush: true' on the final chunk.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| chunk | Yes | The incoming text chunk from the LLM stream or stdout. | |
| flush | No | Optional. Set to true on the final chunk or at EOF to flush remaining buffer. Defaults to false. | |
| reset | No | Optional. Set to true to reset internal streaming buffer for this session. Defaults to false. | |
| session_id | No | Optional session ID matching the sanitize_text call for multi-agent isolation. Defaults to 'default'. |