@mastra/observability 1.19.0-alpha.1 → 1.19.0-alpha.3
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.cjs +11 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +11 -1
- package/dist/index.js.map +1 -1
- package/dist/metrics/estimator.d.ts.map +1 -1
- package/dist/model-tracing.d.ts +5 -0
- package/dist/model-tracing.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1578,7 +1578,7 @@ function estimateCosts(args, pricingRegistry = PricingRegistry.getGlobal()) {
|
|
|
1578
1578
|
}
|
|
1579
1579
|
if (usage.outputDetails?.reasoning) {
|
|
1580
1580
|
const result = estimateCostForMeter({
|
|
1581
|
-
meter: PricingMeter.OUTPUT_REASONING_TOKENS,
|
|
1581
|
+
meter: pricingTier.hasMatchingMeterForUsage(PricingMeter.OUTPUT_REASONING_TOKENS) ? PricingMeter.OUTPUT_REASONING_TOKENS : PricingMeter.OUTPUT_TOKENS,
|
|
1582
1582
|
tokenCount: usage.outputDetails.reasoning,
|
|
1583
1583
|
...estimateFields
|
|
1584
1584
|
});
|
|
@@ -2447,6 +2447,16 @@ var ModelSpanTracker = class {
|
|
|
2447
2447
|
});
|
|
2448
2448
|
}
|
|
2449
2449
|
/**
|
|
2450
|
+
* End the open MODEL_INFERENCE span as interrupted while keeping MODEL_STEP open,
|
|
2451
|
+
* so a replacement request for the same step gets its own inference span.
|
|
2452
|
+
*/
|
|
2453
|
+
interruptInference() {
|
|
2454
|
+
this.#endChunkSpan();
|
|
2455
|
+
if (!this.#currentInferenceSpan) return;
|
|
2456
|
+
this.#currentInferenceSpan.end({ attributes: { finishReason: "interrupted" } });
|
|
2457
|
+
this.#currentInferenceSpan = void 0;
|
|
2458
|
+
}
|
|
2459
|
+
/**
|
|
2450
2460
|
* Update the current step span with additional payload data.
|
|
2451
2461
|
* Called when step-start chunk arrives with request/warnings info.
|
|
2452
2462
|
*/
|