Commit edae2b4b authored by Marco Boers's avatar Marco Boers

socketData { action, queryText}

parent 1d03fcb4
......@@ -18,6 +18,7 @@ const encoding = 'AUDIO_ENCODING_LINEAR_16';
const sampleRateHertz = 16000;
let shouldStream = true;
let detectStream = null;
let socketData = {};
const sessionClient = new dialogflow.SessionsClient();
const sessionPath = sessionClient.sessionPath(projectId, sessionId);
const initialStreamRequest = {
......@@ -57,9 +58,12 @@ function createDetectStream() {
if(data.queryResult) {
shouldStream = true;
console.log(`Detected intent:`);
console.log(sessionClient, data.queryResult);
console.log(`Query text:` + data.queryResult.queryText);
console.log(`Intent:` + data.queryResult.action);
console.log(data.queryResult);
socketData = {
action: data.queryResult.action,
queryText: data.queryResult.queryText
};
console.log(`SocketData:` + socketData);
//console.log(`Parameters:` + data.queryResult.parameters.fields.action);
}
})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment