Repository navigation
Streaming markdown - #1920
Streaming markdown#1920
Conversation
|
Not ready to merge yet |
SummaryAdds newline-delimited streaming support and robust word-wrapping:
ReviewLooks like a well-scoped quality-of-life update—better streaming UX and testability. Strengths
Suggestions
Otherwise, code is tidy, tests comprehensive—good to merge once CI is green! |
| | "response.reasoning_summary_part.added" | ||
| | "response.reasoning_summary_text.done" => { | ||
| // Currently, we ignore these events, but we handle them | ||
| | "response.reasoning_summary_part.added" => { |
There was a problem hiding this comment.
I assume we want this change independent of the markdown work?
| // Currently, we ignore this event, but we handle it | ||
| // separately to skip the logging message in the `other` case. | ||
| } | ||
| "response.reasoning_summary_text.done" => { |
There was a problem hiding this comment.
wrong line, I meant this one
| let line = lines[i]; | ||
| let trimmed_start = line.trim_start(); | ||
| let fence_token = if trimmed_start.starts_with("```") { | ||
| "```" |
There was a problem hiding this comment.
FYI, I believe a fenced code block is "at least three backticks" [where the closing delimiter has to be the same number] so that you can have a sequence of three backticks in the code block. Admittedly pretty rare and not sure if our models would take advantage of that.
There was a problem hiding this comment.
They do if you ask them to write a markdown tutorial!
This seems horrible but it works in my testing
We wait until we have an entire newline, then format it with markdown and stream in to the UI. This reduces time to first token but is the right thing to do with our current rendering model IMO. This will also make word wrapping a lot easier.