agentskit.js

chunkText

Auto-generated API reference for chunkText.

Function: chunkText()

chunkText(text, targetSize?): string[]

Defined in: utils.ts:491

Chunk-splitter that turns one large string into N streamable text chunks. Useful when a provider returns the full response in one shot and you want to feed it to a UI that expects streaming.

Default splits by whitespace boundaries with a target chunk size of ~32 characters.

#Parameters

#text

string

#targetSize?

number = 32

#Returns

string[]

Explore nearby

✎ Edit this page on GitHub·Found a problem? Open an issue →·How to contribute →

On this page