Skip to content

bmel:wordCount

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

bmel:wordCount(text: bmel:string)

Description

Returns the number of whitespace-delimited words in a string. Useful for tracking response verbosity, enforcing output length contracts, and correlating word count with token count to detect abnormal tokenization patterns.

Arguments

Parameter Type Required Description
text bmel:string The text to count words in.

Example

bmel:wordCount({chat:Response Payload}.$.content)

Back to BMEL Reference