Test handling intent through Redis Streams

This commit is contained in:
Apher 2026-07-03 06:20:16 +00:00
parent ed41efcd47
commit efd8439817

View File

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