Skip to content

bmel:mode-of

Category: Array & Statistics · Returns: bmel:any

Signature
bmel:mode-of(array: bmel:array)

Description

Returns the most frequently occurring value in an array. Works on numeric, string, and boolean arrays. When multiple values tie for the highest frequency, returns the one that appears first in sorted order. Returns null for an empty array.

Arguments

Parameter Type Required Description
array bmel:array The array of values to find the mode of.

Examples

Most used model in a run
bmel:mode-of({createChatCompletion:Response Payload[]}.$.model)
Most frequent finish reason
bmel:mode-of({createChatCompletion:Response Payload[]}.$.choices.finish_reason)

← Back to BMEL Reference