View a markdown version of this page

Operators - Elemental Inference

Operators

Arithmetic

Operator Description Example Result
+Addition5 + 38
-Subtraction10 - 46
*Multiplication6 * 742
/Division15 / 43.75
%Modulo17 % 52

Comparison

Operator Description Example
=Equal tomedia.contextual.garm.risk = "LOW"
!=Not equal tostop_reason != "max_tokens"
<Less than$count(media.frames) < 4
>Greater thanusage.output_tokens > 200
<=Less than or equal to$count(media.clip.events) <= 2
>=Greater than or equal tomedia.clip.eventState.period >= 4

Boolean and membership

Operator Description Example
andLogical AND$exists(media.transcript) and $length(media.transcript) > 20
orLogical ORrisk = "HIGH" or risk = "FLOOR"
inTests membership in an array"Basketball" in media.contextual.categories
~>Chains a value into a function as its first argumentmedia.transcript ~> $lowercase ~> $trim

Use parentheses to control precedence.

$count(media.clip.events) > 0 and (risk = "LOW" or risk = "MEDIUM")
Note

There is no not keyword. Use the $not() function.