@wix/evalforge-evaluator 0.208.0 → 0.209.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.js
CHANGED
|
@@ -10966,7 +10966,14 @@ function calculateFromPricing(modelId, tokenUsage) {
|
|
|
10966
10966
|
return tokenUsage.prompt / 1e6 * pricing.input + tokenUsage.completion / 1e6 * pricing.output;
|
|
10967
10967
|
}
|
|
10968
10968
|
function calculateStepCost(step, modelId, provider, tokenUsage) {
|
|
10969
|
-
|
|
10969
|
+
const gatewayCost = extractGatewayCost(step, provider);
|
|
10970
|
+
if (gatewayCost !== void 0) {
|
|
10971
|
+
return gatewayCost;
|
|
10972
|
+
}
|
|
10973
|
+
console.warn(
|
|
10974
|
+
`[cost-calculation] gateway cost missing; using list-price fallback (provider=${provider}, model=${modelId}, promptTokens=${tokenUsage.prompt}, completionTokens=${tokenUsage.completion})`
|
|
10975
|
+
);
|
|
10976
|
+
return calculateFromPricing(modelId, tokenUsage);
|
|
10970
10977
|
}
|
|
10971
10978
|
|
|
10972
10979
|
// src/run-scenario/agents/simple-agent/build-conversation.ts
|