Description
Add a SentenceBuffer utility that accumulates TextDelta chunks and emits complete sentences.
struct SentenceBuffer { buf: String }
impl SentenceBuffer {
fn push(&mut self, delta: &str) -> Vec<String>; // returns completed sentences
fn flush(&mut self) -> Option<String>; // drain remaining text
}
Splits on sentence-ending punctuation: 。!?.!?\n. No async, no I/O, no TTS dependency — pure text segmentation.
This is a reusable building block for any channel that wants sentence-level streaming (Telegram voice reply, future web voice channel, etc.).
Component
kernel (core runtime)
Alternatives considered
- Character-level chunking: produces unnatural TTS prosody.
- Full-response chunking: high latency (current behavior).
- Sentence boundary is the information-theoretic lower bound for natural-sounding TTS chunks.
Description
Add a
SentenceBufferutility that accumulatesTextDeltachunks and emits complete sentences.Splits on sentence-ending punctuation:
。!?.!?\n. No async, no I/O, no TTS dependency — pure text segmentation.This is a reusable building block for any channel that wants sentence-level streaming (Telegram voice reply, future web voice channel, etc.).
Component
kernel (core runtime)
Alternatives considered