Commit 4f09666f authored by Hanna Abdel Massih's avatar Hanna Abdel Massih
Browse files

complementary fixes

parent 97cbdbcd
......@@ -60,6 +60,7 @@ io.on('connection', function (socket) {
var IntentPrivacy = "";
var IntentType = "";
var MediaType = "";
var comp_text = "";
var BatteryLevel = input.battery;
var IsPluggedIn = input.is_charging;
var NoiseLevel = input.noise;
......@@ -104,6 +105,9 @@ io.on('connection', function (socket) {
if (MediaObj.payload.fields.url != undefined) {
I_URL = MediaObj.payload.fields.url.stringValue;
GraphicType = MediaObj.payload.fields.type.stringValue;
if(MediaObj.payload.fields.comp_text){
comp_text= MediaObj.payload.fields.comp_text.stringValue;
}
}
}
}
......@@ -125,7 +129,8 @@ io.on('connection', function (socket) {
IsCharging: IsPluggedIn,
Noise: NoiseLevel,
Intent_Type: IntentType,
Media_Type: MediaType
Media_Type: MediaType,
}
console.log(Context);
......@@ -146,9 +151,11 @@ io.on('connection', function (socket) {
text: JSON.stringify(DFText),
decision: modality,
ImageURL: I_URL,
comp_text: comp_text,
Media: GraphicType,
Audio: OutputAudio
}
console.log(Returned_Object);
if (DetectedIntent == "Default Fallback Intent") {
if (DetectedEmotion.toLowerCase() == "sad" && EmotionConfidence > 0.6) {
Returned_Object.text = "I detected that you are sad, I'm always here by your side.";
......
......@@ -60,6 +60,7 @@ io.on('connection', function (socket) {
var IntentPrivacy = "";
var IntentType = "";
var MediaType = "";
var comp_text = "";
var BatteryLevel = input.battery;
var IsPluggedIn = input.is_charging;
var NoiseLevel = input.noise;
......@@ -104,6 +105,9 @@ io.on('connection', function (socket) {
if (MediaObj.payload.fields.url != undefined) {
I_URL = MediaObj.payload.fields.url.stringValue;
GraphicType = MediaObj.payload.fields.type.stringValue;
if(MediaObj.payload.fields.comp_text){
comp_text= MediaObj.payload.fields.comp_text.stringValue;
}
}
}
}
......@@ -125,7 +129,8 @@ io.on('connection', function (socket) {
IsCharging: IsPluggedIn,
Noise: NoiseLevel,
Intent_Type: IntentType,
Media_Type: MediaType
Media_Type: MediaType,
}
console.log(Context);
......@@ -146,9 +151,11 @@ io.on('connection', function (socket) {
text: JSON.stringify(DFText),
decision: modality,
ImageURL: I_URL,
comp_text: comp_text,
Media: GraphicType,
Audio: OutputAudio
}
console.log(Returned_Object);
if (DetectedIntent == "Default Fallback Intent") {
if (DetectedEmotion.toLowerCase() == "sad" && EmotionConfidence > 0.6) {
Returned_Object.text = "I detected that you are sad, I'm always here by your side.";
......
Supports Markdown
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