From f5c2394bc8010a01922ccd62d80b2ab27abb9b0b Mon Sep 17 00:00:00 2001 From: Apher Date: Wed, 8 Jul 2026 01:28:17 +0000 Subject: [PATCH] Fetch intents from db when transcription needs classification --- src/server.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/server.js b/src/server.js index 93a2a98..5026ae0 100644 --- a/src/server.js +++ b/src/server.js @@ -85,6 +85,8 @@ async function embed(text) { async function classifyIntent(text) { const inputEmbedding = await embed(text); + const INTENTS = getIntents(); + let best = { name: "unknown", confidence: 0, @@ -126,7 +128,7 @@ async function handleIntent(streamKey, msg) { text, }); - console.log("TODO: Handle Intents", intent); + console.log("Handling intent", intent); } async function processor(group, consumer, streamKey) { @@ -166,14 +168,12 @@ const main = async () => { if (doForce) console.info("Database dropped and resynced (force=true)."); - const INTENTS = getIntents(); - await initModel(); await redis.ensureGroup("transcripts", 'nlp'); await redis.ensureGroup("commands", 'nlp'); - processor('nlp', `${config.DEVICE_ID}`, "transcripts").catch(console.error); + processor('nlp', `${config.DEVICE_ID}`, "transcripts", INTENTS).catch(console.error); } main().catch(console.error);