UNPKG

axiom

Version:

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

59 lines (34 loc) 1.11 kB
[**axiom v0.51.1**](../../README.md) *** [axiom](../../README.md) / [evals](../README.md) / EvalTask # Type Alias: EvalTask()\<TInput, TExpected, TOutput\> > **EvalTask**\<`TInput`, `TExpected`, `TOutput`\> = (`args`) => `TOutput` \| `Promise`\<`TOutput`\> \| `AsyncIterable`\<`TOutput`\> Function type for evaluation tasks that process input data and produce output. Used with [EvalParams](EvalParams.md) to define the task that will be evaluated against a dataset. The task output will be scored by functions defined in [EvalParams.scorers](EvalParams.md#scorers). ## Type Parameters ### TInput `TInput` ### TExpected `TExpected` ### TOutput `TOutput` ## Parameters ### args #### expected `TExpected` #### input `TInput` ## Returns `TOutput` \| `Promise`\<`TOutput`\> \| `AsyncIterable`\<`TOutput`\> The task output, Promise, or AsyncIterable for streaming ## Example ```typescript const textGenerationTask: EvalTask<string, string, string> = async ({ input, expected }) => { const result = await generateText({ model: myModel, prompt: input }); return result.text; }; ```