Skip to content

bmel:sentence-count

Category: String · Returns: bmel:integer

Signature
bmel:sentence-count(text: bmel:string)

Description

Returns the number of sentences in a string, detected by terminal punctuation (. ! ?). Useful for measuring response structure and complexity, and for comparing expected vs. actual output density in agentic session frames.

Arguments

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

Examples

Sentences in the answer
bmel:sentence-count({invokeAgent:Response Payload}.$.output_text)
Answers longer than five sentences
bmel:sentence-count({invokeAgent:Response Payload}.$.output_text) > 5

← Back to BMEL Reference