Expand description
In-flight streaming assistant preview.
Renders partial text via full MessageFormatter. Uses a thread-local
parse cache to avoid re-running the markdown formatter on every token:
while the streaming text grows by fewer than [STREAM_REPARSE_THRESHOLD]
bytes since the last parse, the cached lines are reused as-is.
Functions§
- push_
streaming_ preview - Append a streaming preview block when the app is actively receiving text.
- reset_
stream_ parse_ cache - Reset the streaming parse cache. Call when a new assistant turn begins
(e.g.
streaming_textwas cleared) so a shrunken buffer doesn’t keep reusing stale parsed lines.