@mastra/observability 1.9.1-alpha.0 → 1.9.1-alpha.1
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/CHANGELOG.md +6 -0
- package/dist/index.cjs +2 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/usage.d.ts.map +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -18594,7 +18594,8 @@ function extractUsageMetrics(usage, providerMetadata) {
|
|
|
18594
18594
|
if (!isDefined(inputDetails.cacheWrite) && isDefined(anthropic.cacheCreationInputTokens)) {
|
|
18595
18595
|
inputDetails.cacheWrite = anthropic.cacheCreationInputTokens;
|
|
18596
18596
|
}
|
|
18597
|
-
|
|
18597
|
+
const inputAlreadyIncludesCache = hasV3CachedTotals || isDefined(usage.cachedInputTokens) && usage.cachedInputTokens > 0;
|
|
18598
|
+
if (!inputAlreadyIncludesCache && (isDefined(inputDetails.cacheRead) || isDefined(inputDetails.cacheWrite))) {
|
|
18598
18599
|
inputTokens = (usage.inputTokens ?? 0) + (inputDetails.cacheRead ?? 0) + (inputDetails.cacheWrite ?? 0);
|
|
18599
18600
|
}
|
|
18600
18601
|
}
|