Skip to content

bmel:chunkCount

Category: LLM & AI Observability · Returns: bmel:integer

bmel:chunkCount(text: bmel:string, chunkSize: bmel:integer)

Description

Returns the number of chunks that a text would be split into given a fixed chunk size in tokens. Computed as ceil(tokenCount(text) / chunkSize). Useful for estimating RAG retrieval overhead and indexing cost before processing.

Arguments

Parameter Type Required Description
text bmel:string The input text to chunk.
chunkSize bmel:integer Target chunk size in tokens.

Example

bmel:chunkCount({ingest:Request Payload}.$.document, 512)

Back to BMEL Reference