UNPKG

axiom

Version:

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

44 lines (26 loc) 1 kB
[**axiom v0.51.1**](../../../README.md) *** [axiom](../../../README.md) / [scorers/aggregations](../README.md) / AtLeastOneTrialPasses # Variable: AtLeastOneTrialPasses() > `const` **AtLeastOneTrialPasses**: (`opts`) => [`Aggregation`](../type-aliases/Aggregation.md)\<`"pass@k"`\> = `PassAtK` User-friendly alias for PassAtK. Returns 1 if at least one trial passes, 0 otherwise. 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) ``` ## Example ```typescript Scorer('tool-called', fn, { aggregation: AtLeastOneTrialPasses({ threshold: 0.8 }) }) ```