0

We are building a note taking action and want to receive input from a user that can be free text or undefined (a note that we won't know the contents of). We are using Dialogflow and our fulfillment is defined in a webhook.

I've read that we can create a custom event as an optional way to trigger intent without the need for training phrases. However, I haven't been able to get the intent to trigger when I send an input and I am trying to figure out what part I'm missing.

I can get the intent to trigger if we have the user say a 'trigger' phrase before the note and define that trigger phrase as a training phrase ex. "This is my note" [ User dictates their note ].

I want the conversation to go something like

What do you want to do today?

Create a new note

Okay, let's go! What is your note!

[ User dictates their note ]

In Dialogflow I have a Default Welcome Intent, a Default Fallback Intent and a Create Voice Note Intent which has a followup intent "Create Voice Note - Custom"

My webhook code looks like this

app.intent("create voice note", (conv) => {
    conv.ask("Okay, lets go! What is your note?");
});

app.intent("create voice note - custom", (conv) => {
    conv.ask("Here's what I have so far: ", conv.input.raw)
});
islalobo
  • 617
  • 2
  • 8
  • 22
  • Make sure that you have required context when you want to trigger the followup intent, Dialogflow automatically generates contexts for followup intents, so it is easy to miss. – Denis Feb 22 '19 at 16:44
  • Thank you! This was helpful. The other thing that I ended up doing was making the followup intent a fallback intent and that allowed it to capture whatever the user submitted as an input. – islalobo Feb 25 '19 at 20:52

1 Answers1

1

You could set a context from the create voice note intent and then capture the users note with a fallback intent that is scoped to that context. This fallback intent will then be triggered if the user input (i.e. the note) does not match any other intent, i.e. de-facto always. The full text that the user has spoken is then included as the queryResult.queryText parameter in the webhook request.

gmolau
  • 2,815
  • 1
  • 22
  • 45