@axlsdk/eval 0.10.2 → 0.10.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +10 -5
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -85,7 +85,7 @@ const qualityJudge = llmScorer({
85
85
  });
86
86
  ```
87
87
 
88
- ### `runEval(config, executeFn)`
88
+ ### `runEval(config, executeFn, provider?, runtime?)`
89
89
 
90
90
  Run an evaluation:
91
91
 
@@ -162,11 +162,12 @@ By default, the eval runner calls `runtime.execute(workflow, input)` for each da
162
162
 
163
163
  For self-contained evals, export an `executeWorkflow` function alongside the config. This is called instead of `runtime.execute()` for each dataset item.
164
164
 
165
- The function receives `(input, runtime?)` — the second argument is the `AxlRuntime` instance when running via Studio or `runtime.runRegisteredEval()`. Use it to call agents without needing a registered workflow:
165
+ The function receives `(input, runtime?)` — the second argument is the `AxlRuntime` instance when running via Studio or `runtime.runRegisteredEval()`. It is `undefined` when running via the CLI. Use it to call agents without needing a registered workflow:
166
166
 
167
167
  ```typescript
168
168
  // evals/qa-quality.eval.ts — calls an agent directly via the runtime
169
169
  import { defineEval, dataset, scorer } from '@axlsdk/eval';
170
+ import type { AxlRuntime } from '@axlsdk/axl';
170
171
  import { z } from 'zod';
171
172
  import { qaAgent } from '../src/agents/qa.js'; // import your agent definition
172
173
 
@@ -191,15 +192,15 @@ export default defineEval({
191
192
  scorers: [notEmpty],
192
193
  });
193
194
 
194
- export async function executeWorkflow(input: { question: string }, runtime?: any) {
195
- // runtime is the AxlRuntime instance — use it to call agents
195
+ export async function executeWorkflow(input: { question: string }, runtime?: AxlRuntime) {
196
+ if (!runtime) throw new Error('This eval requires a runtime — run via Studio or runtime.runRegisteredEval()');
196
197
  const ctx = runtime.createContext();
197
198
  const output = await ctx.ask(qaAgent, input.question);
198
199
  return { output };
199
200
  }
200
201
  ```
201
202
 
202
- When no runtime is needed (e.g., testing a pure function), just ignore the second argument:
203
+ When no runtime is needed (e.g., testing a pure function), just ignore the second argument — these evals work from both the CLI and Studio:
203
204
 
204
205
  ```typescript
205
206
  // evals/parser.eval.ts — tests a pure function, no runtime needed
@@ -209,6 +210,10 @@ export async function executeWorkflow(input: { raw: string }) {
209
210
  }
210
211
  ```
211
212
 
213
+ > **Note:** The CLI (`npx axl eval`) does not provide a runtime to `executeWorkflow`. Eval files that call agents via `runtime.createContext()` must be run through Studio or `runtime.runRegisteredEval()`.
214
+
215
+ > **Cost tracking:** The default path (no `executeWorkflow` export) tracks cost automatically via runtime trace events. Custom `executeWorkflow` functions must return `{ output, cost }` manually if cost tracking is needed — `createContext()` does not capture cost automatically.
216
+
212
217
  ## CLI
213
218
 
214
219
  Run evaluations from the command line:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@axlsdk/eval",
3
- "version": "0.10.2",
3
+ "version": "0.10.3",
4
4
  "description": "Evaluation framework for Axl agentic workflows",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -25,7 +25,7 @@
25
25
  "dist"
26
26
  ],
27
27
  "dependencies": {
28
- "@axlsdk/axl": "0.10.2"
28
+ "@axlsdk/axl": "0.10.3"
29
29
  },
30
30
  "devDependencies": {
31
31
  "@types/node": "^25.2.3",