@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.mjs CHANGED
@@ -11025,7 +11025,14 @@ function calculateFromPricing(modelId, tokenUsage) {
11025
11025
  return tokenUsage.prompt / 1e6 * pricing.input + tokenUsage.completion / 1e6 * pricing.output;
11026
11026
  }
11027
11027
  function calculateStepCost(step, modelId, provider, tokenUsage) {
11028
- return extractGatewayCost(step, provider) ?? calculateFromPricing(modelId, tokenUsage);
11028
+ const gatewayCost = extractGatewayCost(step, provider);
11029
+ if (gatewayCost !== void 0) {
11030
+ return gatewayCost;
11031
+ }
11032
+ console.warn(
11033
+ `[cost-calculation] gateway cost missing; using list-price fallback (provider=${provider}, model=${modelId}, promptTokens=${tokenUsage.prompt}, completionTokens=${tokenUsage.completion})`
11034
+ );
11035
+ return calculateFromPricing(modelId, tokenUsage);
11029
11036
  }
11030
11037
 
11031
11038
  // src/run-scenario/agents/simple-agent/build-conversation.ts