UNPKG

@mastra/core

Version:
17 lines • 944 B
/** Threshold configuration: a number implies minimum, or an object with min/max bounds. */ export type ThresholdConfig = number | { min?: number; max?: number; }; /** A scorer reference with an associated pass/fail threshold. */ export type ScorerWithThreshold<TScorer> = { scorer: TScorer; /** A number implies minimum threshold. Use { min, max } for range-based checks. */ threshold: ThresholdConfig; }; /** A scorer entry: either a bare scorer reference or one with a threshold. */ export type ScorerEntry<TScorer> = TScorer | ScorerWithThreshold<TScorer>; export declare function checkThresholdPassed(score: number, threshold: ThresholdConfig): boolean; export declare function isScorerWithThreshold<TScorer>(entry: ScorerEntry<TScorer>): entry is ScorerWithThreshold<TScorer>; export declare function validateThresholdConfig(threshold: ThresholdConfig, scorerId: string): void; //# sourceMappingURL=thresholds.d.ts.map