Skip to content

StreamMode

StreamMode = "delta" | "accumulated"

Defined in: packages/ai.matey.types/src/streaming.ts:23

Streaming mode determines how chunks are delivered.

  • delta: Stream only new content chunks (standard behavior, most efficient)

    • Each chunk contains only the incremental text that was just generated
    • Consumers must accumulate chunks to get full text
    • Example: chunk1=“Hello”, chunk2=“ world“, chunk3=“!”
  • accumulated: Stream full accumulated content so far (Chrome AI behavior)

    • Each chunk contains all text generated up to that point
    • Consumers can use the latest chunk directly without accumulation
    • Example: chunk1=“Hello”, chunk2=“Hello world”, chunk3=“Hello world!”