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);