symfonic.agent.presentation_stream¶
presentation_stream ¶
Incremental release of stream text that final presentation will not retract.
Presentation removes extraction directives and citation tags, and it can do so
retroactively: a bare trailing JSON object is only recognisable once the reply
ends. So a delta is released only up to the first character that could begin
something presentation might remove, minus trailing whitespace (the legacy
strip rstrips and its directive patterns consume leading whitespace).
What is released is therefore always a prefix of the final visible text.
The cost is latency, not content: text from the first <, backtick, {,
[ or GRAPH_OPERATIONS onward arrives at the end of the turn.
HoldBackStream ¶
Feeds raw deltas in; yields only text the final answer keeps.
Source code in src/symfonic/agent/presentation_stream.py
finish ¶
Return the not-yet-released tail of the visible text and its parse.
final_raw is the result's text. If the streamed deltas did not sum
to it, the released prefix cannot be trusted and no tail is emitted:
the done event still carries the correct final text.