> ## Documentation Index
> Fetch the complete documentation index at: https://docs.fiddler.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# QueryRule

> A single filter comparison: `field`, `operator`, `value`.

## Example

```python theme={null}
from fiddler_evals import OperatorType, QueryRule

# Spans that used more than 4,000 tokens
heavy = QueryRule(
    field="SpanAttribute::gen_ai.usage.total_tokens",
    operator=OperatorType.GREATER,
    value=4000,
)
```

## Attributes

<ResponseField name="field" type="str">
  Name of the field to compare. Span filters use namespaced names such as
  `Span::span_type`, `SpanAttribute::gen_ai.usage.total_tokens`, or
  `Evaluator::Safety::Is Toxic`; see `get_span_fields()` on
  [`Application`](/sdk-api/evals/application).
</ResponseField>

<ResponseField name="operator" type="str">
  Comparison to apply. Pass an [`OperatorType`](/sdk-api/evals/operator-type) member (for example
  `OperatorType.EQUAL`) or its string value (`"equal"`).
</ResponseField>

<ResponseField name="value" type="Any">
  Value to compare against. Most operators take a single value; `in` and
  `not_in` take a non-empty list, `between` and `not_between` take a
  two-element `[low, high]` list, and `is_null`, `is_not_null`,
  `is_empty`, and `is_not_empty` ignore it (pass `None`).
</ResponseField>
