Add state transitions

Autogenerated YouTube transcript

[00:00] All right, now let’s add more state

transitions into our bot if you go and click on this state 25 the state you will see that the only thing that we have right now is you have entered state 25 the entry dialog what I’m going to do is I’m going to add an intent in the intent routes in this page so here this is one of the nicest features in Dialogflow CX you can just reuse an intent you have declared before

[00:30] so

in our case we know that we already created this add a quarter intent which has this phrase which just says add a quarter and now when I select that intent notice that it allows me to change the response in other words you can have different responses for the same intent based on which page you have added that intent into that is what is the state

[01:00] the current state of the bot and that

makes perfect sense if you think about it because if you are in state 25 and you add 25 cents by adding a quarter and let’s say that the agent is going to give you the balance right if it’s in state 0 and you add a quarter of the balance here it should say 25 cents on the other hand if you are already in state 25. And then you add a quarter the ball balance should say 50 cents it shouldn’t say 25 cents. Right. So this is an important distinction because

[01:30] in the case

of Dialogflow ES you will come back it will come back with the same response I when I say it comes back with the same response what I’m really saying is yes it you can select from a set of possible responses. But that’s actually selected at random as you know right here the concept is very different you took an intent which we have already declared but you have changed the response not random randomly selected from a list but

[02:00] you have actually changed the

you know the meaning of the response because you are able to edit the fulfillment depending on which state you are in right now. But in our case I’m just going to say you have added a quarter I’m not going to provide the balance here that’s what I mean. But I will change the state to state 50 that is I’m going to transition to the page called state 50.. Let’s save this

[02:30] now let’s go to state 50 and

. If it doesn’t open you can actually click on this edit here and in the fulfillment I’m going to say you have entered state 50. Okay now save it and let’s test it quickly I’m going to start with add a quarter you can see that it’s coming back with. Okay I added a quarter you have now

[03:00] entered state 25

. It’s already in state 25 so if I were to say add a quarter again you can see that it says you have added a quarter you have entered state 50 which is exactly what we want let’s continue in that same fashion now we are in state 50 let’s edit state 50 and go to the page view of okay what I’m going to do is minimize this and expand this

[03:30] state 50 we will add a new intent

. Well we are just adding the old intent back into this new page and once again the agent says okay you have added quarter. And then it will transition to state 75 right let’s save that and let’s go to state 75 and in the entry dialog we will just say ️

[04:00] you have now entered

state 75 that’s pretty much. All we have for the in terms of changing the state let’s go ahead and test the agent we start by saying add a quarter you have entered state 25 then I say add a quarter you have entered state 50.. You say add a quarter

[04:30] and you can see that it’s now entered

state 75 we don’t allow the user to add any more quarters you remember the logic of the vending machine so this is explaining to you what is going on in terms of the state transitions that is the page transitions in our bot and if you come to the visualization of the flow you can see that it’s got this nice. I guess you can say that it’s got this nice flow diagram where you can see that

[05:00] the bot is able to move from start to

state 25 to state 50 to state 75 now you may not be able to see the full details so if you remember the image that I had here you can even see exactly which text moves it from which state to which state that level of granularity is not available in the overall view in your CX console but you could click on this

[05:30]. Right. And then you can see

you should click on this specific intents and you do have this information here and of course the reason for that is because they are trying to provide you with the most compact representation of the flow diagram if it was if they tried to provide all this information in one view I am pretty sure that there will be so much information on this page that you will not be able to make sense of what is going on so they have to you know decide on some kind of trade-offs as to how how much of a high level

[06:00] picture

they can show on this flow diagram. And I think that to me it looks like a reasonably good balance till now so what we have done now with this particular video is that we have added all the state transitions into our Vendee bot.

Transcript auto-formatted using ATF

Free: Dialogflow ES Crash course for non-programmers

I recently changed the name of my website from Mining Business Data to BotFlo. To help spread the word, and to hopefully get people to bookmark my website, I am making a set of my training courses free for a few weeks. 

Learn more
"The magic key I needed as a non-programmer"

The custom payload generator was the magic key I needed (as a non-programmer) to build a good demo with rich responses in DialogFlow Messenger. I've only used it for 30 minutes and am thrilled. I've spent hours trying to figure out some of the intricacies of DialogFlow on my own. Over and over, I kept coming back to Aravind's tutorials available on-line. I trust the other functionalities I learn to use in the app will save me additional time and heartburn.

- Kathleen R
Cofounder, gathrHealth