@absolutejs/voice 0.0.22-beta.283 → 0.0.22-beta.284
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 +2 -1
- package/dist/productionReadiness.d.ts +1 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -27833,7 +27833,8 @@ var summarizeDeliveryRuntime = (summary) => {
|
|
|
27833
27833
|
var summarizeLiveLatency = (events, options) => {
|
|
27834
27834
|
const warnAfterMs = options.liveLatencyWarnAfterMs ?? 1800;
|
|
27835
27835
|
const failAfterMs = options.liveLatencyFailAfterMs ?? 3200;
|
|
27836
|
-
const
|
|
27836
|
+
const minAt = typeof options.liveLatencyMaxAgeMs === "number" && Number.isFinite(options.liveLatencyMaxAgeMs) && options.liveLatencyMaxAgeMs > 0 ? Date.now() - options.liveLatencyMaxAgeMs : undefined;
|
|
27837
|
+
const latencies = events.filter((event) => event.type === "client.live_latency" && (minAt === undefined || event.at >= minAt)).map((event) => typeof event.payload.latencyMs === "number" ? event.payload.latencyMs : typeof event.payload.elapsedMs === "number" ? event.payload.elapsedMs : undefined).filter((value) => typeof value === "number");
|
|
27837
27838
|
const failed = latencies.filter((value) => value > failAfterMs).length;
|
|
27838
27839
|
const warnings = latencies.filter((value) => value > warnAfterMs && value <= failAfterMs).length;
|
|
27839
27840
|
const averageLatencyMs = latencies.length > 0 ? Math.round(latencies.reduce((total, value) => total + value, 0) / latencies.length) : undefined;
|
|
@@ -481,6 +481,7 @@ export type VoiceProductionReadinessRoutesOptions = {
|
|
|
481
481
|
ttsProviders?: readonly string[];
|
|
482
482
|
liveLatencyWarnAfterMs?: number;
|
|
483
483
|
liveLatencyFailAfterMs?: number;
|
|
484
|
+
liveLatencyMaxAgeMs?: number;
|
|
484
485
|
};
|
|
485
486
|
export declare const summarizeVoiceProductionReadinessGate: (report: VoiceProductionReadinessReport, options?: VoiceProductionReadinessGateOptions) => VoiceProductionReadinessGateReport;
|
|
486
487
|
export declare const evaluateVoiceProductionReadinessEvidence: (report: VoiceProductionReadinessReport, input?: VoiceProductionReadinessAssertionInput) => VoiceProductionReadinessAssertionReport;
|