diff --git a/src/server.js b/src/server.js index 3314c9a..1536db7 100644 --- a/src/server.js +++ b/src/server.js @@ -9,13 +9,13 @@ const redis = models.redis; const config = require("./config"); // Send Speech to Text to Redis Stream -const sendTranscriptEvent = async (streamKey, type, text) => { +const sendTranscriptEvent = async (streamKey, device_id, text) => { await redis.client.xAdd( streamKey, '*', { text: text, - type: type + device_id: device_id } ) @@ -26,7 +26,7 @@ const sendTranscriptEvent = async (streamKey, type, text) => { const processor = async (group, consumer, streamKey) => { await redis.client.connect().catch(console.error); - sendTranscriptEvent("speech:events", "TEST", "TEST"); + sendTranscriptEvent("transcripts", config.DEVICE_ID, "TEST"); while (true) { const res = await redis.client.xReadGroup( @@ -51,9 +51,9 @@ const processor = async (group, consumer, streamKey) => { } const main = async () => { - await redis.ensureGroup("speech:commands", `${config.DEVICE_ID}-cg`); + await redis.ensureGroup("commands", 'assistant'); - processor(`${config.DEVICE_ID}-cg`, `${config.DEVICE_ID}-consumer`, "speech:commands"); + processor('assistant', `${config.DEVICE_ID}`, "commands"); } main().catch(console.error); \ No newline at end of file