Change attribute and stream names.

This commit is contained in:
Apher 2026-07-05 06:01:14 +00:00
parent efd8439817
commit aa00d45eef

View File

@ -15,8 +15,9 @@ const handleIntent = async (streamKey, intent) => {
streamKey,
'*',
{
intent_id: intent.id,
command: "INTENT_RECEIVED"
transcript_id: intent.id,
command: "[TEST] INTENT_RECEIVED",
device_id: intent.message.device_id
}
)
console.log("TODO: Handle Intents", intent);
@ -39,7 +40,7 @@ const processor = async (group, consumer, streamKey) => {
for (const msg of stream.messages) {
console.log(`[${consumer}] Processing:`, msg);
await handleIntent("speech:commands", msg);
await handleIntent("commands", msg);
await redis.client.xAck(streamKey, group, msg.id);
}
@ -56,9 +57,10 @@ const main = async () => {
await sequelize.sync({force: doForce});
if (doForce) console.info("Database dropped and resynced (force=true).");
await redis.ensureGroup("speech:events", `${config.DEVICE_ID}-cg`);
await redis.ensureGroup("transcripts", 'nlp');
await redis.ensureGroup("commands", 'nlp');
processor(`${config.DEVICE_ID}-cg`, `${config.DEVICE_ID}-consumer`, "speech:events");
processor('nlp', `${config.DEVICE_ID}`, "transcripts");
}
main().catch(console.error);