Tutorial 1: Basic conversation flow

更新时间:
复制 MD 格式

A basic conversation flow collects information to complete a task. For example, a leave request flow collects the number of leave days and the applicant's name to submit the request.

Create a conversation flow

Go to Chatbot Center > Dialog Studio and click New Conversation Flow. Enter 'Leave Request' as the conversation flow name.

Enter the canvas

Find the 'Leave Request' conversation flow that you created. Click Edit on the right side of the flow to open the canvas.

Create an entity

Go to Entity Management and click Add Standard Entity. Set the entity name to 'Leave Applicant Name' and customize the entity code. Click Create. Enter the entity members 'Zhang San', 'Li Si' (with 'Li Sier' as a synonym), and 'Wang Wu', and then click Save.

Create an intent

Go to Intent Management and click New Intent. Enter 'Leave Request' as the intent name and define an intent code. Click Create, then configure the user expressions.

Create a user input node

Open the 'Leave Request' conversation flow. From the left pane, drag a User Input Node to the canvas and connect it to the start node. Click the new node to configure it. Enter 'Leave Request Trigger' as the node name. For the intent name, select the 'Leave Request' intent that you created. The system automatically synchronizes the trigger conditions and user expressions after you select the intent.

Create a slot filling node

From the left pane, drag a Slot Filling Node to the canvas and connect it to the user input node. Click the new node and enter 'Collect Leave Information' as the node name.

Click Add Slot. Configure two slots. The first slot collects the applicant's name. For the detection method, select the 'Applicant Name' entity that you created. The second slot collects the number of leave days. For the detection method, select System-Number.

Select the checkbox to make the slots required.

Click Edit to configure the follow-up questions for the slots. The chatbot uses these questions to prompt the user if they do not provide the required information. For the 'Name' slot, enter 'What is your name?'. For the 'Leave Days' slot, enter 'How many days of leave are you requesting?'.

Create a response node

From the left pane, drag a Response Node to the canvas and connect it to the slot filling node. Click the new node to configure it. Enter 'Submit Leave Request' as the node name. In the Text Response field, enter 'The leave request for ${LeaveDays.origin} days for ${Name} has been successfully submitted.' When you type the $ symbol, the system automatically suggests variables.

Submit test

Click Save Draft to save the conversation flow, and then click Test. The system automatically checks the configuration. After the check passes, you can test the conversation flow in the debugging window.