@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/out/plugin.zip
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
Binary file
|
|
@@ -328,15 +328,24 @@ export class TrackingEngine {
|
|
|
328
328
|
}
|
|
329
329
|
|
|
330
330
|
/** Check and record LLM call - returns false if rate limited */
|
|
331
|
-
private tryLlmCall(): boolean {
|
|
331
|
+
private tryLlmCall(silent: boolean = false): boolean {
|
|
332
332
|
if (!this.isLlmCallAllowed()) {
|
|
333
|
-
|
|
333
|
+
// Only log once per rate limit window, not every call
|
|
334
|
+
if (!silent && !this.rateLimitLogged) {
|
|
335
|
+
const remaining = Math.ceil((this.config.llmDebounceInterval || 30000) - (Date.now() - this.lastLlmCallTime)) / 1000;
|
|
336
|
+
this.console.log(`[LLM] Rate limited, ${remaining.toFixed(0)}s until next call allowed`);
|
|
337
|
+
this.rateLimitLogged = true;
|
|
338
|
+
}
|
|
334
339
|
return false;
|
|
335
340
|
}
|
|
341
|
+
this.rateLimitLogged = false;
|
|
336
342
|
this.recordLlmCall();
|
|
337
343
|
return true;
|
|
338
344
|
}
|
|
339
345
|
|
|
346
|
+
/** Track if we've already logged rate limit message */
|
|
347
|
+
private rateLimitLogged: boolean = false;
|
|
348
|
+
|
|
340
349
|
/** Get spatial reasoning result for movement (uses RAG + LLM) with debouncing and fallback */
|
|
341
350
|
private async getSpatialDescription(
|
|
342
351
|
tracked: TrackedObject,
|
package/src/main.ts
CHANGED
|
@@ -130,7 +130,7 @@ export class SpatialAwarenessPlugin extends ScryptedDeviceBase
|
|
|
130
130
|
llmDebounceInterval: {
|
|
131
131
|
title: 'LLM Rate Limit (seconds)',
|
|
132
132
|
type: 'number',
|
|
133
|
-
defaultValue:
|
|
133
|
+
defaultValue: 5,
|
|
134
134
|
description: 'Minimum time between LLM calls to prevent API rate limiting. Increase if you get rate limit errors. (0 = no limit)',
|
|
135
135
|
group: 'AI & Spatial Reasoning',
|
|
136
136
|
},
|