Hi ,
Can you please guide me that somehow I can make a like and dislike button at the last of every conversation.
I want the Thumbs up and Thumbs Down button at the last of every conversation.
Please help in that.
Hi ,
Can you please guide me that somehow I can make a like and dislike button at the last of every conversation.
I want the Thumbs up and Thumbs Down button at the last of every conversation.
Please help in that.
@renisweta1094, Below is a thought I had on achieving your use case.
Hope this helps
The other way to handle this usecase is from the botkit.
It might be a tough job for the developer to link the dialog at end of conversation flow at the dialogs, considering the fact that there could be many end of dialog flows and even many dialogs in the bot.
Other problem area for the developer would be invoking the âUser Satisfactionâ dialog after an FAQ response.
These can be addressed if the botkit is enabled at the bot and is configured to have the onEvent received. At the bot kit, you could have the logic to trigger the dialog when the eventTypes âendFAQâ or âendDialogâ are received at the bot kit.
Below is sample snippet at botkit for your reference.
on_event: function(requestId, data, callback)
{
if ( data.event.eventType === âendDialogâ)
{
data.message = âUser Satisfactionâ;
return sdk.sendBotMessage(data, callback);
}
else {
return callback(null, data);
}
}
Please Help, Itâs not working!!!
I have tried the same thing and I have debugged to confirm that request was sent to the bot platform and the messaging endpoint sendBotMessageUrl returned 200 OKs but the bot didnât respond.
there was no message from the bot, on_bot_message was never triggered.
function onEvent(requestId, data, callback)
{
if (data.event.eventType === "endDialog")
{
if(data.event.completedTaskName === "userfeedback" && data.event.endReason === "Fulfilled")
{
if(data.channel.body !=":+1:" && data.channel.body != ":-1:")
{//ex this is for utterance ex 'hello'
data.message = data.channel.body;
return sdk.sendBotMessage(data,callback);
}
else
{
return callback(null, data);
}
}
else
{
data.message = 'UserFeedback';
return sdk.sendBotMessage(data,callback);
}
}
else
{
return callback(null, data);
}
}
any updates?
if (data.event.eventType === "endDialog" || data.event.eventType ==="endFAQ")
{
if(data.event.completedTaskName === "userfeedback" && data.event.endReason === "Fulfilled")
{
return callback(null, data);
}
else
{
var test= JSON.stringify(data);
data.message = 'UserFeedback';
return sdk.sendBotMessage(data,callback);
}
}
else
{
return callback(null, data);
}
@damaresh.n
I am able to configure a feedback dialog and call it from botkit.
Here is my code (Basically, I am checking if the end of dialog is from a task other than feedback, I am calling feedback, else, just displaying the current total likes)
on_event: function (requestId, data, callback) {
console.log("on_event ==> Event details:");
console.log(data.event);
if (data.event.eventType === "endDialog") {
console.log("end of dialog processing");
if (data.event.completedTaskName != "feedbackdialog" && data.event.endReason === "Fulfilled"){
console.log("Dialog executed: " + data.event.completedTaskName);
data.message = "feedbackdialog";
return sdk.sendBotMessage(data, callback);
} else {
console.log("Feedback dialog executed. Total likes " + data.context.session.BotContext.TOTAL_LIKES);
return callback(null, data);
}
}
}
Here is how the feedbackDialog is set up. In the script nodes, I am just using a bot context variable to increment to increment or reduce total likes:
var totLikesPresent = BotContext.get("TOTAL_LIKES");
if(totLikesPresent === undefined){
BotContext.put("TOTAL_LIKES",1);
} else {
totLikesPresent +=1;
BotContext.put("TOTAL_LIKES",totLikesPresent);
}
Bot output
BotKit console:
Some tips:
Hi Swagati
I have done almost the same thing that you have explained in your reply, even after that it was not working. i even when down debugging to check what was the response from platform for sendBotMessageUrl request but it always returned success message.
so finally i decided to take a fresh copy of botkit and migrate my solution and its working fine now.
One last problem which i have is handling interruptions in middle of feedback dialog, right now when user says something other than confirmation values its going to none Intent but we have a proper response in KB for that utterance
and i have set the interruption behavior as well properly
if you see in the chat history, first time its picking proper response but second time as its in middle of Dialog Task and as its interrupted its going to Default_Intent.
@damaresh.n
Try using intent over entity setting and try once. This works much better in entity LoV instead of confirmation node. You can take the value of yes/ no like in confirmation in list of value entity and configure transitions.
Thank you it worked.