UNPKG

axiom

Version:

Axiom AI SDK provides - an API to wrap your AI calls with observability instrumentation. - offline evals - online evals

35 lines (20 loc) 736 B
[**axiom v0.51.1**](../../../README.md) *** [axiom](../../../README.md) / [scorers/aggregations](../README.md) / PassHatK # Function: PassHatK() > **PassHatK**(`opts?`): [`Aggregation`](../type-aliases/Aggregation.md)\<`"pass^k"`\> Returns 1 if all trial scores meet or exceed the threshold, 0 otherwise. Also known as "pass^k" in evaluation literature. ## Parameters ### opts? #### threshold? `number` The minimum score required for all trials to pass ## Returns [`Aggregation`](../type-aliases/Aggregation.md)\<`"pass^k"`\> ## Example ```typescript Scorer('consistency', fn, { aggregation: PassHatK({ threshold: 0.9 }) }) // scores [0.95, 0.92, 0.91] => 1 (all >= 0.9) // scores [0.95, 0.85, 0.91] => 0 (0.85 < 0.9) ```