Skip to content

bmel:containsAny

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

bmel:containsAny(text: bmel:string, patterns: bmel:array)

Description

Returns true if the text contains at least one string from the provided array. Case-insensitive by default. Useful for detecting hallucination markers, toxicity patterns, PII keywords, or known failure signatures in LLM outputs without requiring a full embedding-based classifier.

Arguments

Parameter Type Required Description
text bmel:string The text to search within.
patterns bmel:array Array of strings to search for. Returns true on the first match found.

Example

bmel:containsAny({chat:Response Payload}.$.content, ["I cannot", "I'm unable", "As an AI"])

Back to BMEL Reference