From efd8439817d7c535b80787af612c5fab33e73092 Mon Sep 17 00:00:00 2001 From: Apher Date: Fri, 3 Jul 2026 06:20:16 +0000 Subject: [PATCH] Test handling intent through Redis Streams --- src/server.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/server.js b/src/server.js index 07b722a..188935b 100644 --- a/src/server.js +++ b/src/server.js @@ -10,7 +10,15 @@ const {sequelize, Sequelize} = db; const config = require("./config"); -const handleIntent = async (intent) => { +const handleIntent = async (streamKey, intent) => { + await redis.client.xAdd( + streamKey, + '*', + { + intent_id: intent.id, + command: "INTENT_RECEIVED" + } + ) console.log("TODO: Handle Intents", intent); } @@ -31,7 +39,7 @@ const processor = async (group, consumer, streamKey) => { for (const msg of stream.messages) { console.log(`[${consumer}] Processing:`, msg); - await handleIntent(msg); + await handleIntent("speech:commands", msg); await redis.client.xAck(streamKey, group, msg.id); }