@blueharford/scrypted-spatial-awareness 0.6.31 → 0.6.32
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/main.nodejs.js +1 -1
- package/dist/main.nodejs.js.map +1 -1
- package/dist/plugin.zip +0 -0
- package/out/main.nodejs.js +11 -3
- package/out/main.nodejs.js.map +1 -1
- package/out/plugin.zip +0 -0
- package/package.json +1 -1
- package/session-manager-plugin.pkg +0 -0
- package/src/core/tracking-engine.ts +11 -2
- package/src/main.ts +1 -1
package/dist/plugin.zip
CHANGED
|
Binary file
|
package/out/main.nodejs.js
CHANGED
|
@@ -37502,14 +37502,22 @@ class TrackingEngine {
|
|
|
37502
37502
|
this.lastLlmCallTime = Date.now();
|
|
37503
37503
|
}
|
|
37504
37504
|
/** Check and record LLM call - returns false if rate limited */
|
|
37505
|
-
tryLlmCall() {
|
|
37505
|
+
tryLlmCall(silent = false) {
|
|
37506
37506
|
if (!this.isLlmCallAllowed()) {
|
|
37507
|
-
|
|
37507
|
+
// Only log once per rate limit window, not every call
|
|
37508
|
+
if (!silent && !this.rateLimitLogged) {
|
|
37509
|
+
const remaining = Math.ceil((this.config.llmDebounceInterval || 30000) - (Date.now() - this.lastLlmCallTime)) / 1000;
|
|
37510
|
+
this.console.log(`[LLM] Rate limited, ${remaining.toFixed(0)}s until next call allowed`);
|
|
37511
|
+
this.rateLimitLogged = true;
|
|
37512
|
+
}
|
|
37508
37513
|
return false;
|
|
37509
37514
|
}
|
|
37515
|
+
this.rateLimitLogged = false;
|
|
37510
37516
|
this.recordLlmCall();
|
|
37511
37517
|
return true;
|
|
37512
37518
|
}
|
|
37519
|
+
/** Track if we've already logged rate limit message */
|
|
37520
|
+
rateLimitLogged = false;
|
|
37513
37521
|
/** Get spatial reasoning result for movement (uses RAG + LLM) with debouncing and fallback */
|
|
37514
37522
|
async getSpatialDescription(tracked, fromCameraId, toCameraId, transitTime, currentCameraId) {
|
|
37515
37523
|
const fallbackEnabled = this.config.llmFallbackEnabled ?? true;
|
|
@@ -39373,7 +39381,7 @@ class SpatialAwarenessPlugin extends sdk_1.ScryptedDeviceBase {
|
|
|
39373
39381
|
llmDebounceInterval: {
|
|
39374
39382
|
title: 'LLM Rate Limit (seconds)',
|
|
39375
39383
|
type: 'number',
|
|
39376
|
-
defaultValue:
|
|
39384
|
+
defaultValue: 5,
|
|
39377
39385
|
description: 'Minimum time between LLM calls to prevent API rate limiting. Increase if you get rate limit errors. (0 = no limit)',
|
|
39378
39386
|
group: 'AI & Spatial Reasoning',
|
|
39379
39387
|
},
|