@wix/evalforge-evaluator 0.206.0 → 0.208.0
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.
package/build/index.mjs
CHANGED
|
@@ -10961,7 +10961,7 @@ var MODEL_PRICING = {
|
|
|
10961
10961
|
"claude-opus-4-5": { input: 5, output: 25 },
|
|
10962
10962
|
"claude-sonnet-4-5": { input: 3, output: 15 },
|
|
10963
10963
|
"claude-haiku-4-5": { input: 1, output: 5 },
|
|
10964
|
-
// Anthropic — Claude 4
|
|
10964
|
+
// Anthropic — Claude 4.0 (retired; kept so historical runs still show cost)
|
|
10965
10965
|
"claude-opus-4": { input: 15, output: 75 },
|
|
10966
10966
|
"claude-sonnet-4": { input: 3, output: 15 },
|
|
10967
10967
|
// OpenAI — GPT-5
|
|
@@ -11305,13 +11305,13 @@ async function executeWithAiSdk(context) {
|
|
|
11305
11305
|
[text, steps, rawUsage] = await Promise.all([
|
|
11306
11306
|
stream.text,
|
|
11307
11307
|
stream.steps,
|
|
11308
|
-
stream.
|
|
11308
|
+
stream.totalUsage
|
|
11309
11309
|
]);
|
|
11310
11310
|
} else {
|
|
11311
11311
|
const result = await generateText(sdkParams);
|
|
11312
11312
|
text = result.text;
|
|
11313
11313
|
steps = result.steps;
|
|
11314
|
-
rawUsage = result.
|
|
11314
|
+
rawUsage = result.totalUsage;
|
|
11315
11315
|
}
|
|
11316
11316
|
const durationMs = Date.now() - startTime;
|
|
11317
11317
|
const usage = {
|
|
@@ -11322,7 +11322,6 @@ async function executeWithAiSdk(context) {
|
|
|
11322
11322
|
const llmTrace = buildLLMTrace2(
|
|
11323
11323
|
steps,
|
|
11324
11324
|
durationMs,
|
|
11325
|
-
usage,
|
|
11326
11325
|
modelId,
|
|
11327
11326
|
provider,
|
|
11328
11327
|
startTime,
|
|
@@ -11471,7 +11470,7 @@ function findToolResultError(step) {
|
|
|
11471
11470
|
}
|
|
11472
11471
|
return null;
|
|
11473
11472
|
}
|
|
11474
|
-
function buildLLMTrace2(steps, totalDurationMs,
|
|
11473
|
+
function buildLLMTrace2(steps, totalDurationMs, modelId, provider, executionStartMs, stepTimestamps) {
|
|
11475
11474
|
const traceSteps = steps.map((step, i) => {
|
|
11476
11475
|
const stepFinishedAt = stepTimestamps[i] ?? executionStartMs;
|
|
11477
11476
|
const stepStartedAt = i === 0 ? executionStartMs : stepTimestamps[i - 1] ?? executionStartMs;
|
|
@@ -11503,11 +11502,14 @@ function buildLLMTrace2(steps, totalDurationMs, totalUsage, modelId, provider, e
|
|
|
11503
11502
|
};
|
|
11504
11503
|
});
|
|
11505
11504
|
const totalCostUsd = traceSteps.reduce((sum, s) => sum + s.costUsd, 0);
|
|
11506
|
-
const finalTokens =
|
|
11507
|
-
|
|
11508
|
-
|
|
11509
|
-
|
|
11510
|
-
|
|
11505
|
+
const finalTokens = traceSteps.reduce(
|
|
11506
|
+
(acc, s) => ({
|
|
11507
|
+
prompt: acc.prompt + s.tokenUsage.prompt,
|
|
11508
|
+
completion: acc.completion + s.tokenUsage.completion,
|
|
11509
|
+
total: acc.total + s.tokenUsage.total
|
|
11510
|
+
}),
|
|
11511
|
+
{ prompt: 0, completion: 0, total: 0 }
|
|
11512
|
+
);
|
|
11511
11513
|
return {
|
|
11512
11514
|
id: randomUUID3(),
|
|
11513
11515
|
steps: traceSteps,
|