mirror of
https://github.com/legop3/MultiRoombaRover.git
synced 2026-09-16 01:21:20 -04:00
fixes nameses
This commit is contained in:
@@ -11,8 +11,8 @@ timezone: "America/New_York"
|
|||||||
llmCommentary:
|
llmCommentary:
|
||||||
enabled: false
|
enabled: false
|
||||||
model: "qwen2.5:7b-instruct"
|
model: "qwen2.5:7b-instruct"
|
||||||
ollamaUrl: "http://127.0.0.1:11434"
|
ollamaServer: "http://127.0.0.1:11434"
|
||||||
frequencyMs: 120000
|
frequency: 120000
|
||||||
media:
|
media:
|
||||||
# Base address for mediaMTX (scheme + host + optional port/path). The UI will always request
|
# Base address for mediaMTX (scheme + host + optional port/path). The UI will always request
|
||||||
# http://<base>/<roverId>/whep
|
# http://<base>/<roverId>/whep
|
||||||
|
|||||||
@@ -22,7 +22,9 @@ const SKIP_TOKEN = 'SKIP';
|
|||||||
const config = loadConfig();
|
const config = loadConfig();
|
||||||
const commentaryConfig = config.llmCommentary || {};
|
const commentaryConfig = config.llmCommentary || {};
|
||||||
const enabled = Boolean(commentaryConfig.enabled);
|
const enabled = Boolean(commentaryConfig.enabled);
|
||||||
const ollamaUrl = String(commentaryConfig.ollamaUrl || '').trim();
|
const ollamaUrl = String(
|
||||||
|
commentaryConfig.ollamaUrl || commentaryConfig.ollamaServer || '',
|
||||||
|
).trim();
|
||||||
const model = String(commentaryConfig.model || '').trim();
|
const model = String(commentaryConfig.model || '').trim();
|
||||||
const timezone = String(config.timezone || 'UTC');
|
const timezone = String(config.timezone || 'UTC');
|
||||||
|
|
||||||
@@ -31,10 +33,12 @@ let inFlight = false;
|
|||||||
|
|
||||||
function normalizeFrequencyMs(value) {
|
function normalizeFrequencyMs(value) {
|
||||||
if (!Number.isFinite(value)) return DEFAULT_FREQUENCY_MS;
|
if (!Number.isFinite(value)) return DEFAULT_FREQUENCY_MS;
|
||||||
return Math.max(MIN_FREQUENCY_MS, Math.floor(value));
|
// If frequency is configured as a small integer, treat it as seconds for convenience.
|
||||||
|
const parsed = value > 0 && value < 1000 ? value * 1000 : value;
|
||||||
|
return Math.max(MIN_FREQUENCY_MS, Math.floor(parsed));
|
||||||
}
|
}
|
||||||
|
|
||||||
const frequencyMs = normalizeFrequencyMs(Number(commentaryConfig.frequencyMs));
|
const frequencyMs = normalizeFrequencyMs(Number(commentaryConfig.frequency ?? commentaryConfig.frequencyMs));
|
||||||
|
|
||||||
function localTimeString(date, tz) {
|
function localTimeString(date, tz) {
|
||||||
try {
|
try {
|
||||||
@@ -241,7 +245,7 @@ function start() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
logger.info('LLM commentary enabled', { model, ollamaUrl, frequencyMs, promptPath: PROMPT_PATH });
|
logger.info('LLM commentary enabled', { model, ollamaUrl, frequencyMs, promptPath: PROMPT_PATH });
|
||||||
scheduleNextTick();
|
runTick();
|
||||||
}
|
}
|
||||||
|
|
||||||
start();
|
start();
|
||||||
|
|||||||
Reference in New Issue
Block a user