t.usage.cacheRead.rate() and queries by purpose from 0.17, and adds reusable type declarations for purposes.
Upgrade the dependency in your eval project:
Share model purposes
Extract a declaration withdefineModelRoles, then reference it from the experiment’s models and the Adapter-bound eval’s requires.models.
Adding requires.models to defineAdapter also narrows the purpose keys in ctx.models and ctx.recordUsage.
For a complete example, see Check cache read rate by purpose.
0.18 still accepts the 0.17 syntax that omits requires, validating names at the call site.
The root exports defineEval and defineScoreEval belong to the Agent path. Shared declarations extend only the Adapter-bound factories.
Purpose requirements do not bind an eval to a specific experiment or fixed model values.
Update duplicate import entry points
For example, import a custom scoring criterion as follows:
process.env, explicitly choose whether to preserve or change that behavior.
The text matcher’s stripComments option remains available and is unaffected by the removal of the utility function with the same name.
Replace project numeric helpers
statistics in the value returned by quantile contains sampleCount, probability, and method.
An empty collection returns no-samples, and non-finite samples return non-finite-sample. Invalid probability or method arguments throw an error.
measured returns non-finite-number for non-finite numbers.
fraction must be within [0, 1]. t.score does not clamp out-of-range values for you.