Re-prompting users after invalid inputUnable to get bot to initiate a dialog with the user at a particular point in the conversation, using 'Event' or 'FollowupEvent'. What's the solution?Facebook Messenger postback button NOT triggering Dialogflow Eventdialogflow (api.ai) intent redirection for translate webhookNumber input & validationDialogFlow NodeJs - Set Response Message after webhookClient.setFollowupEventDialogflow : display “processing” message on intents triggered by followup eventsRedirect user to the Default Welcome Intent when he says “cancel” or “exit”Remove DialogFlow response in web-hook fulfillmentIntent gets recognized correctly but finds entities only on second tryHow can I receive input from user without defining training phrases for Actions on Google

Multi tool use
Why does independence imply zero correlation?
King or Queen-Which piece is which?
How do internally carried IR missiles acquire a lock?
Is there any proof that high saturation and contrast makes a picture more appealing in social media?
Counterfeit checks were created for my account. How does this type of fraud work?
How many people are necessary to maintain modern civilisation?
When Bnei Yisroel travelled in the midbar, what happened on Shabbos?
Is there a term for the belief that "if it's legal, it's moral"?
How could empty set be unique if it could be vacuously false
Explicit song lyrics checker
Umlaut character order when sorting
How did the Vostok ejection seat safely eject an astronaut from a sealed space capsule?
What was the flower of Empress Taytu?
Helping ease my back pain by studying 13 hours everyday , even weekends
Dmesg full of I/O errors, smart ok, four disks affected
How do I professionally let my manager know I'll quit over an issue?
Prisoner on alien planet escapes by making up a story about ghost companions and wins the war
Why isn't my calculation that we should be able to see the sun well beyond the observable universe valid?
I just entered the USA without passport control at Atlanta airport
What is the highest voltage from the power supply a Raspberry Pi 3 B can handle without getting damaged?
Draw a symmetric alien head
Print one file per line using echo
Where should a runway for a spaceplane be located?
In the US, can a former president run again?
Re-prompting users after invalid input
Unable to get bot to initiate a dialog with the user at a particular point in the conversation, using 'Event' or 'FollowupEvent'. What's the solution?Facebook Messenger postback button NOT triggering Dialogflow Eventdialogflow (api.ai) intent redirection for translate webhookNumber input & validationDialogFlow NodeJs - Set Response Message after webhookClient.setFollowupEventDialogflow : display “processing” message on intents triggered by followup eventsRedirect user to the Default Welcome Intent when he says “cancel” or “exit”Remove DialogFlow response in web-hook fulfillmentIntent gets recognized correctly but finds entities only on second tryHow can I receive input from user without defining training phrases for Actions on Google
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
I'm setting up a reset password intent using Dialogflow, where I'm performing some validation via webhooks. Unfortunately, I'm not able to figure out how to reprompt the user in case of failed validation.
I've tried to trigger the intent again using an event, but it doesn't seem to be working. I've also tried setting the same input contexts to trigger the intent again, but neither seem to work.
So I've created 2 parameters within the intent, which are being filled via prompts, following which I am performing the validation. Here's the code:
function getPasscode(agent)
console.log(agent.parameters);
if(/^d6$/.test(agent.parameters.code1) && agent.parameters.code1 == agent.parameters.code2)
// Reset passcode call
else
return new Promise((resolve, reject) =>
agent.add("Your codes don't match. Please try again.");
var output = JSON.stringify("followupEvent": "name": "GetPasscode", "data": )
resolve(output);
);
The bot outputs the text properly, but isn't triggering the event, as intended.
Am I missing something?
dialogflow
add a comment |
I'm setting up a reset password intent using Dialogflow, where I'm performing some validation via webhooks. Unfortunately, I'm not able to figure out how to reprompt the user in case of failed validation.
I've tried to trigger the intent again using an event, but it doesn't seem to be working. I've also tried setting the same input contexts to trigger the intent again, but neither seem to work.
So I've created 2 parameters within the intent, which are being filled via prompts, following which I am performing the validation. Here's the code:
function getPasscode(agent)
console.log(agent.parameters);
if(/^d6$/.test(agent.parameters.code1) && agent.parameters.code1 == agent.parameters.code2)
// Reset passcode call
else
return new Promise((resolve, reject) =>
agent.add("Your codes don't match. Please try again.");
var output = JSON.stringify("followupEvent": "name": "GetPasscode", "data": )
resolve(output);
);
The bot outputs the text properly, but isn't triggering the event, as intended.
Am I missing something?
dialogflow
add a comment |
I'm setting up a reset password intent using Dialogflow, where I'm performing some validation via webhooks. Unfortunately, I'm not able to figure out how to reprompt the user in case of failed validation.
I've tried to trigger the intent again using an event, but it doesn't seem to be working. I've also tried setting the same input contexts to trigger the intent again, but neither seem to work.
So I've created 2 parameters within the intent, which are being filled via prompts, following which I am performing the validation. Here's the code:
function getPasscode(agent)
console.log(agent.parameters);
if(/^d6$/.test(agent.parameters.code1) && agent.parameters.code1 == agent.parameters.code2)
// Reset passcode call
else
return new Promise((resolve, reject) =>
agent.add("Your codes don't match. Please try again.");
var output = JSON.stringify("followupEvent": "name": "GetPasscode", "data": )
resolve(output);
);
The bot outputs the text properly, but isn't triggering the event, as intended.
Am I missing something?
dialogflow
I'm setting up a reset password intent using Dialogflow, where I'm performing some validation via webhooks. Unfortunately, I'm not able to figure out how to reprompt the user in case of failed validation.
I've tried to trigger the intent again using an event, but it doesn't seem to be working. I've also tried setting the same input contexts to trigger the intent again, but neither seem to work.
So I've created 2 parameters within the intent, which are being filled via prompts, following which I am performing the validation. Here's the code:
function getPasscode(agent)
console.log(agent.parameters);
if(/^d6$/.test(agent.parameters.code1) && agent.parameters.code1 == agent.parameters.code2)
// Reset passcode call
else
return new Promise((resolve, reject) =>
agent.add("Your codes don't match. Please try again.");
var output = JSON.stringify("followupEvent": "name": "GetPasscode", "data": )
resolve(output);
);
The bot outputs the text properly, but isn't triggering the event, as intended.
Am I missing something?
dialogflow
dialogflow
asked Mar 25 at 6:51
Saurav SircarSaurav Sircar
909
909
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
Remember that Intents represent what the user does and not what your action is trying to do. In general, you don't "trigger" an Intent - the user does.
So if you're "reprompting" the user - send that prompt in your reply to them. Then make sure the Intent is setup to capture their reply. This may involve in your setting an Output Context to narrow which Intents are evaluated to consider the reply.
You can't both send back a response and trigger an Intent with an event. Sending an event from your fulfillment is almost never needed and, when done, discards anything you may already have set for a response. All it does is cause the Intent with the event registered to it to be triggered. (Your code has two problems in this respect - you both try to send a response, and you're trying to send the followup event incorrectly.)
I understand that, but events are used to trigger intents, with the necessary parameters right? So can't I call an event itself to re-prompt?
– Saurav Sircar
Mar 25 at 8:21
Intents don't "prompt" - they respond. In theory, you can trigger an event which would send the reply that an Intent does - but this doesn't mean "wait for the user to say something". I clarified my answer a bit.
– Prisoner
Mar 25 at 11:28
add a comment |
In your use-case, you do not need to call the event as per my understanding. Better way to do this is :
- Set-up intent where you ask and confirm the password and store it
- Validate this in your webhook
Here is the pseudo code:
if validationPassed
call your api to reset password
send reset password confirmation output to user
if validationFailed
setup output context to ask-password intent again
send output to user to re-enter the password
As @Prisoner says, you do not trigger an intent, the user does. We do the processing and send the response once the intent is triggered.
Hope it helps.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55332542%2fre-prompting-users-after-invalid-input%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Remember that Intents represent what the user does and not what your action is trying to do. In general, you don't "trigger" an Intent - the user does.
So if you're "reprompting" the user - send that prompt in your reply to them. Then make sure the Intent is setup to capture their reply. This may involve in your setting an Output Context to narrow which Intents are evaluated to consider the reply.
You can't both send back a response and trigger an Intent with an event. Sending an event from your fulfillment is almost never needed and, when done, discards anything you may already have set for a response. All it does is cause the Intent with the event registered to it to be triggered. (Your code has two problems in this respect - you both try to send a response, and you're trying to send the followup event incorrectly.)
I understand that, but events are used to trigger intents, with the necessary parameters right? So can't I call an event itself to re-prompt?
– Saurav Sircar
Mar 25 at 8:21
Intents don't "prompt" - they respond. In theory, you can trigger an event which would send the reply that an Intent does - but this doesn't mean "wait for the user to say something". I clarified my answer a bit.
– Prisoner
Mar 25 at 11:28
add a comment |
Remember that Intents represent what the user does and not what your action is trying to do. In general, you don't "trigger" an Intent - the user does.
So if you're "reprompting" the user - send that prompt in your reply to them. Then make sure the Intent is setup to capture their reply. This may involve in your setting an Output Context to narrow which Intents are evaluated to consider the reply.
You can't both send back a response and trigger an Intent with an event. Sending an event from your fulfillment is almost never needed and, when done, discards anything you may already have set for a response. All it does is cause the Intent with the event registered to it to be triggered. (Your code has two problems in this respect - you both try to send a response, and you're trying to send the followup event incorrectly.)
I understand that, but events are used to trigger intents, with the necessary parameters right? So can't I call an event itself to re-prompt?
– Saurav Sircar
Mar 25 at 8:21
Intents don't "prompt" - they respond. In theory, you can trigger an event which would send the reply that an Intent does - but this doesn't mean "wait for the user to say something". I clarified my answer a bit.
– Prisoner
Mar 25 at 11:28
add a comment |
Remember that Intents represent what the user does and not what your action is trying to do. In general, you don't "trigger" an Intent - the user does.
So if you're "reprompting" the user - send that prompt in your reply to them. Then make sure the Intent is setup to capture their reply. This may involve in your setting an Output Context to narrow which Intents are evaluated to consider the reply.
You can't both send back a response and trigger an Intent with an event. Sending an event from your fulfillment is almost never needed and, when done, discards anything you may already have set for a response. All it does is cause the Intent with the event registered to it to be triggered. (Your code has two problems in this respect - you both try to send a response, and you're trying to send the followup event incorrectly.)
Remember that Intents represent what the user does and not what your action is trying to do. In general, you don't "trigger" an Intent - the user does.
So if you're "reprompting" the user - send that prompt in your reply to them. Then make sure the Intent is setup to capture their reply. This may involve in your setting an Output Context to narrow which Intents are evaluated to consider the reply.
You can't both send back a response and trigger an Intent with an event. Sending an event from your fulfillment is almost never needed and, when done, discards anything you may already have set for a response. All it does is cause the Intent with the event registered to it to be triggered. (Your code has two problems in this respect - you both try to send a response, and you're trying to send the followup event incorrectly.)
edited Mar 25 at 11:27
answered Mar 25 at 8:11
PrisonerPrisoner
37.7k43965
37.7k43965
I understand that, but events are used to trigger intents, with the necessary parameters right? So can't I call an event itself to re-prompt?
– Saurav Sircar
Mar 25 at 8:21
Intents don't "prompt" - they respond. In theory, you can trigger an event which would send the reply that an Intent does - but this doesn't mean "wait for the user to say something". I clarified my answer a bit.
– Prisoner
Mar 25 at 11:28
add a comment |
I understand that, but events are used to trigger intents, with the necessary parameters right? So can't I call an event itself to re-prompt?
– Saurav Sircar
Mar 25 at 8:21
Intents don't "prompt" - they respond. In theory, you can trigger an event which would send the reply that an Intent does - but this doesn't mean "wait for the user to say something". I clarified my answer a bit.
– Prisoner
Mar 25 at 11:28
I understand that, but events are used to trigger intents, with the necessary parameters right? So can't I call an event itself to re-prompt?
– Saurav Sircar
Mar 25 at 8:21
I understand that, but events are used to trigger intents, with the necessary parameters right? So can't I call an event itself to re-prompt?
– Saurav Sircar
Mar 25 at 8:21
Intents don't "prompt" - they respond. In theory, you can trigger an event which would send the reply that an Intent does - but this doesn't mean "wait for the user to say something". I clarified my answer a bit.
– Prisoner
Mar 25 at 11:28
Intents don't "prompt" - they respond. In theory, you can trigger an event which would send the reply that an Intent does - but this doesn't mean "wait for the user to say something". I clarified my answer a bit.
– Prisoner
Mar 25 at 11:28
add a comment |
In your use-case, you do not need to call the event as per my understanding. Better way to do this is :
- Set-up intent where you ask and confirm the password and store it
- Validate this in your webhook
Here is the pseudo code:
if validationPassed
call your api to reset password
send reset password confirmation output to user
if validationFailed
setup output context to ask-password intent again
send output to user to re-enter the password
As @Prisoner says, you do not trigger an intent, the user does. We do the processing and send the response once the intent is triggered.
Hope it helps.
add a comment |
In your use-case, you do not need to call the event as per my understanding. Better way to do this is :
- Set-up intent where you ask and confirm the password and store it
- Validate this in your webhook
Here is the pseudo code:
if validationPassed
call your api to reset password
send reset password confirmation output to user
if validationFailed
setup output context to ask-password intent again
send output to user to re-enter the password
As @Prisoner says, you do not trigger an intent, the user does. We do the processing and send the response once the intent is triggered.
Hope it helps.
add a comment |
In your use-case, you do not need to call the event as per my understanding. Better way to do this is :
- Set-up intent where you ask and confirm the password and store it
- Validate this in your webhook
Here is the pseudo code:
if validationPassed
call your api to reset password
send reset password confirmation output to user
if validationFailed
setup output context to ask-password intent again
send output to user to re-enter the password
As @Prisoner says, you do not trigger an intent, the user does. We do the processing and send the response once the intent is triggered.
Hope it helps.
In your use-case, you do not need to call the event as per my understanding. Better way to do this is :
- Set-up intent where you ask and confirm the password and store it
- Validate this in your webhook
Here is the pseudo code:
if validationPassed
call your api to reset password
send reset password confirmation output to user
if validationFailed
setup output context to ask-password intent again
send output to user to re-enter the password
As @Prisoner says, you do not trigger an intent, the user does. We do the processing and send the response once the intent is triggered.
Hope it helps.
answered Mar 27 at 8:13


sid8491sid8491
4,08131340
4,08131340
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55332542%2fre-prompting-users-after-invalid-input%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Z2Nbi,njO2dQA480tu7rMZlXKzvbA1MnqIdHYUabi9x68gkRPIP mIhEhQP2vzF0v Xg5Vnsng5WFKQHuCha0,EGfyJ tzSEw49ETN