bmel:word-count¶
Category: String · Returns: bmel:integer
Signature
bmel:word-count(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. |
Examples¶
Words in the answer
bmel:word-count({invokeAgent:Response Payload}.$.output_text)
Words per sentence
bmel:word-count({invokeAgent:Response Payload}.$.output_text) / bmel:sentence-count({invokeAgent:Response Payload}.$.output_text)