Intent Attribute

(Autogenerated transcript)

[00:00:00]
 In this video, I'm going to explain this intent attribute that you're setting inside the df messenger tag. In the previous video, we sort of went over this concept very quickly. So it's possible that you didn't fully understand like what it represents and what you can do with the tag. So usually the welcome event is what automatically fires in Dialogflow when you don't have a custom welcome event set in your agent. And also if you've noticed, as soon as you create a fresh Dialogflow agent, it has this Default Welcome intent as part of the agent creation. And it also automatically adds this event called welcome into that welcome intent, which means that for all practical purposes, that is what Dialogflow provides out of the box as the intent which fires when your agent, when somebody starts talking to your agent.

[00:01:00]
 But it's actually possible to change the welcome intent. So what I'm going to do is I'm going to change this to a different event and I'm just going to call it parallel. Now let's go back to the Dialogflow console and I'm going to call it parallel universe welcome intent. And here, all I'm going to do is I'm going to literally add an event called parallel. Notice that it is all uppercase. So the case, it is case sensitive. It has to match the, it has to match, that is the case of the event has to match with what you're using inside your intent attribute. And let's go back here. And here I'm going to have a response, which is hello from the parallel universe or something like that. So let's go ahead and save this.

[00:02:00]
 And I'm going to go back to my WebStorm editor. And now if I open this page, what you should see is the welcome event is being replaced by the parallel event. And that means that the response coming back from the Dialogflow agent, in other words, whatever is the prompt message which shows up has to be different. So you can see now that it says hello from the parallel universe. And just to clarify, I'm going to change this to lowercase. Save it and run it again. And well, it still comes back. So I'm going to take back what I said before. I suppose that the event name is not case sensitive. Now, I think that it used to be, maybe I'm just completely wrong about that.

[00:03:00]
 But either way, now you know that you can use like case insensitive event names here. And that would still trigger that intent. But I think you've got the main point of this video, which is that it's actually possible to change the message which comes back based on the event that you're setting over here. And that could be different from the actual welcome event or the, you know, the intent which automatically fires when the bot opened.