From 96df20c2aa8ef64108aa59ca6a19ce70c26c47dc Mon Sep 17 00:00:00 2001 From: Sam Machin Date: Thu, 13 Jan 2022 08:20:07 +0000 Subject: [PATCH] add dialogRequestID to help --- README.md | 6 ++++++ nodes/avs.html | 4 ++++ package.json | 2 +- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index f4e4e6f..b7f2432 100644 --- a/README.md +++ b/README.md @@ -5,16 +5,22 @@ This node will allow you to interact with the Alexa Voice Service (the same API ### Inputs : payload (buffer) : the audio to send to the service. +: *dialogRequestId* (string) : Where the audio is part of an existing dialog the ID from the previous response + ### Outputs : payload (object) : the response from the Alexa Voice Service, certain objects will be binary audio buffers. +: dialogRequestId (string) : the dialog ID either as was set on the input or a new random string. + AVS responds with a multipart object, the Node will parse this into a single object, ### Details `msg.payload` should be 16Khz PCM Mono audio, the node will attempt to convert any buffer input using ffmpeg but ideally you should capture in the correct format. +`msg.dialogRequestId` is used by AVS to assocaite multiple interactions within the same conversation, if you are starting a new dialog this does not need to be set on the input and the node will generate one. For replies it should match the previous response + `AVS Endpoint` is the avs server nearest to your application, Europe, US and Asia values are pre-set or advanced users can manually set this to another value. The `Access Token` should usually be passed in as a parameter on the message object as these have a limited time to live, however you can also hard code it or reference a context object. diff --git a/nodes/avs.html b/nodes/avs.html index 50cdc78..c7e1eba 100644 --- a/nodes/avs.html +++ b/nodes/avs.html @@ -102,16 +102,20 @@ ### Inputs : payload (buffer) : the audio to send to the service. +: *dialogRequestId* (string) : Where the audio is part of an existing dialog the ID from the previous response ### Outputs : payload (object) : the response from the Alexa Voice Service, certain objects will be binary audio buffers. +: dialogRequestId (string) : the dialog ID either as was set on the input or a new random string. ### Details `msg.payload` should be 16Khz PCM Mono audio, the node will attempt to convert any buffer input using ffmpeg but ideally you should capture in the correct format. +`msg.dialogRequestId` is used by AVS to assocaite multiple interactions within the same conversation, if you are starting a new dialog this does not need to be set on the input and the node will generate one. For replies it should match the previous response + `AVS Endpoint` is the avs server nearest to your application, Europe, US and Asia values are pre-set or advanced users can manually set this to another value. The `Access Token` should usually be passed in as a parameter on the message object as these have a limited time to live, however you can also hard code it or reference a context object. diff --git a/package.json b/package.json index afc7cb8..1cb1b72 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@sammachin/node-red-alexa-voice-service", - "version": "0.1.0", + "version": "0.1.1", "description": "Node-RED nodes for the Alexa Voice Service", "main": "index.js", "scripts": {