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) 734 B
[**axiom v0.51.1**](../../../README.md) *** [axiom](../../../README.md) / [scorers/aggregations](../README.md) / PassAtK # Function: PassAtK() > **PassAtK**(`opts?`): [`Aggregation`](../type-aliases/Aggregation.md)\<`"pass@k"`\> Returns 1 if at least one trial score meets or exceeds the threshold, 0 otherwise. Also known as "pass@k" in evaluation literature. ## Parameters ### opts? #### threshold? `number` The minimum score required for a trial to pass ## Returns [`Aggregation`](../type-aliases/Aggregation.md)\<`"pass@k"`\> ## Example ```typescript Scorer('tool-called', fn, { aggregation: PassAtK({ threshold: 0.8 }) }) // scores [0.5, 0.9, 0.6] => 1 (0.9 >= 0.8) // scores [0.5, 0.6, 0.7] => 0 (none >= 0.8) ```