官术网_书友最值得收藏!

Creating a conversation flow diagram

Now that we know the parts of a conversation flow diagram, let's create one. We'll use the same pizza order conversation that we used earlier.

Start at the very beginning of the conversation. Create a symbol for the user's first utterance. This first message from the user is a really important one as it will trigger an intent:

Utterance triggering an intent

Now that the OrderPizza intent has been triggered, our chatbot can start asking the user about the pizza they want to order. We'll start by asking what topping they want and they reply with "Hawaiian":

Starting the intent

Later on, we want to remember that they chose Hawaiian as their topping so we need to store this as a slot. We store the information against a slot name, so in this case, it will be topping = Hawaiian. As well as storing the slot, we need to carry on the conversation, asking them what size of pizza they want:

Storing a slot value

With the response from the user, we store the size in a slot and proceed to the next stage. We repeat the question, answer, slot process for the size of pizza the user wants. 

Now that we have all of the information that we need, we need to tell the pizzeria that someone has ordered a medium Hawaiian pizza. For this, we'll use the action symbol and make sure to include the slots that are required. When we include slot information into anything, it is normal to write it as the slot name wrapped in curly braces.

As well as telling the pizzeria about the order, we need to let the user know that their order has been placed and tell them when to collect it. Again, we use the slot name wrapped in curly braces to customize the message with slot information:

Full pizza ordering flow diagram
主站蜘蛛池模板: 高邑县| 太湖县| 三门县| 寿光市| 涪陵区| 新津县| 连州市| 莱阳市| 河西区| 乐陵市| 南投县| 古蔺县| 杭锦后旗| 九寨沟县| 乳源| 遂宁市| 依安县| 孝昌县| 沿河| 鹤峰县| 吴川市| 玉环县| 巴塘县| 咸宁市| 定陶县| 岗巴县| 黄龙县| 寻甸| 仙居县| 浦江县| 博野县| 兰坪| 田林县| 江口县| 内黄县| 云梦县| 宁国市| 乌兰察布市| 湾仔区| 吴桥县| 西青区|