@polka-codes/core 0.9.34 → 0.9.35
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/dist/index.js +4 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1322,10 +1322,10 @@ var UsageMeter = class {
|
|
|
1322
1322
|
};
|
|
1323
1323
|
const usage = "totalUsage" in resp ? resp.totalUsage : resp.usage;
|
|
1324
1324
|
const result = this.#calculageUsage(usage, resp.providerMetadata, modelInfo);
|
|
1325
|
-
this.#totals.input += result.input;
|
|
1326
|
-
this.#totals.output += result.output;
|
|
1327
|
-
this.#totals.cachedRead += result.cachedRead;
|
|
1328
|
-
this.#totals.cost += result.cost;
|
|
1325
|
+
this.#totals.input += result.input || 0;
|
|
1326
|
+
this.#totals.output += result.output || 0;
|
|
1327
|
+
this.#totals.cachedRead += result.cachedRead || 0;
|
|
1328
|
+
this.#totals.cost += result.cost || 0;
|
|
1329
1329
|
this.#totals.messageCount += 1;
|
|
1330
1330
|
}
|
|
1331
1331
|
/** Override the running totals (e.g., restore from saved state). */
|