CandidateTrace

class CandidateTrace(val prompt: String, val similarity: Double, val aboveThreshold: Boolean, val guardVerdicts: Map<String, GuardVerdict>)

One candidate entry and every guard's verdict on it, from a CacheExplanation.

The difference from a real lookup is that guardVerdicts holds every guard's verdict, not just the first rejection. A lookup stops at the first guard that objects, because one veto is enough to refuse; an explanation keeps going, because when you are tuning you want to know that three guards objected and which three, not only that the first did.

Constructors

Link copied to clipboard
constructor(prompt: String, similarity: Double, aboveThreshold: Boolean, guardVerdicts: Map<String, GuardVerdict>)

Properties

Link copied to clipboard

Whether similarity cleared the threshold. A guard verdict on a candidate below it is moot.

Link copied to clipboard

Every guard's verdict, in the order the guards run, keyed by MatchGuard.name. The guards are evaluated in the same direction a lookup uses them — query against this cached prompt.

Link copied to clipboard

The cached prompt this candidate holds.

Link copied to clipboard

The guards that rejected this candidate, in guard order. Empty when every guard abstained.

Link copied to clipboard

Its similarity to the query, in [-1.0, 1.0].

Link copied to clipboard

True when this candidate cleared the threshold and no guard rejected it.

Functions

Link copied to clipboard
open override fun toString(): String