Skip to content

trulens.core.utils.constants

trulens.core.utils.constants

This module contains common constants used throughout the trulens

Attributes

UNPARSABLE_SCORE module-attribute

UNPARSABLE_SCORE = -1.0

Sentinel score returned when a judge's reply could not be parsed.

Feedback scores are otherwise normalized to the 0 to 1 range, so this value sits outside it on purpose and is never a verdict. TruLens's own aggregates skip it and guardrails reject it. Integrators that compare a score against a threshold should check [is_unparsable_score][] first.

Functions

is_unparsable_score

is_unparsable_score(score: float) -> bool

Whether score is the sentinel for an unparsable judge reply.

Only the exact sentinel counts. NaN and infinities are not the sentinel and are left for the caller to handle.