Case 1. Data Usage
Last updated
Last updated
This tutorial requires a webhook setup. Add a test webhook URL http://mock-webhook.mind.ai
to your webhook settings.
Click Add Subject on the Scope details page.
Select the Info Search
tab.
Enter a Subject name.
Enter Query Statement which is the expected customer query as "How much data have I used on my account?"
Click Recognize Statement to get the Recognition Result. The Recommended Statement is the statement which is semantically related to more ontologies and can generally capture more statement structures with the same intent. To use the recommended statement, just tick the checkbox saying Use Recommended Statement.
6. Additional Query Statement to Recognize may also be added but not required. This is used in case of multiple intents being expected to trigger this subject.
7. Click Add.
Click Add Component in the Components panel.
Click Parameter Bundle.
3. In the popup, enter a Parameter Bundle name as "Check Month" and a Parameter name as "Month". Set it as required.
4. Click Add.
5. In the Component Settings panel, stay with the Single Value
tab.
6. Enter the local binding key as "month".
7. Click Set up Entity Type.
8. In the popup, select the System Entities
tab.
9. Select Datetime Entity
.
10. Click Submit.
11. Click Save.
12. Click Add Action in the Conversation panel.
13. Under Check for Parameter, click Check.
14. Stay with the Customer
tab.
15. Enter the prompt as "For which month?"
16. Click Save.
17. Click Add Action in the Conversation panel.
18. Under Completion of Parameter, click Show response.
19. Select the Webhook
tab.
20. Choose a webhook URL http://mock-webhook.mind.ai
to use from the dropdown and enter URL Parameter (domain path and/or query string) as tutorial/data-usage?code=200
Webhook URL (Method: POST)
**BASE URL **`
http://mock-webhook.mind.ai`
**URL PARAMETER **`
tutorial/data-usage?code=200`
Response Body
21. Select the request method as POST
. For the POST
request, you can enter the Request Body if needed. Enter the Request Body.
Request Body
22. **** Select an error message display method as Template
and select an action as Terminate
to take in case of HTTP 400. If Passthrough
is selected, the webhook response will be displayed without modification.
23. Enter an error message that will be displayed to the customer.
24. Keep the Mapping toggle on.
25. Enter Key and JSONPath pairings for Result Mapping.
Result Mapping Pair 1
KEY month
JSONPATH $.month
Result Mapping Pair 2
KEY data_usage
JSONPATH $.data-usage
26. Enter the template to show to the customer as a response.
27. Click Save.
28. Click Publish to publish the Subject.
29. To test the subject, click on the sandbox button on the right side of the screen and enter the query statement configured, in this case, How much data have I used?
.