Case 2. Data Plans

Before you begin

This tutorial requires a webhook setup. Add a test webhook URL http://mock-webhook.mind.ai to your webhook settings.

Add a Subject

1. Click Add Subject on the Scope details page.

2. Stay in the Q&A tab.

3. Enter a Subject name.

4. Enter Query Statement which is the expected customer query as "I want to see the mobile plans."

5. Click Recognize Statement to get the Recognition Result.

6. 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.

7. Click Submit.

8. 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.

9. Click Add.

Build the Subject

  1. Click Add Action in the Conversation panel.

  2. Under AI Response, Click Show response.

  3. Select the Webhook tab.

4. 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/mobile-plan-list?code=200

Webhook URL (Method: GET)

BASE URL http://mock-webhook.mind.ai

**URL PARAMETER **` tutorial/mobile-plan-list?code=200`

****

Response Body

{
 "plan-list": [
  {
   "plan-id": "10000002"
   "name": "4G+ data 25 plan"
   "amount": "$22"
   "data": "25G limited"
   "comment": "Speed will be reduced when exceeded maximum usage (25G)"
  }
  {
   "plan-id": "11000003",
   "name": "4G+ data 35 plan",
   "amount": "$28",
   "data": "35G limited",
   "comment": "Speed will be reduced when exceeded maximum usage (35G)"
  },
  {
   "plan-id": "12000004",
   "name": "4G+ data 60 plan",
   "amount": "$35",
   "data": "60G limited",
   "comment": "Speed will be reduced when exceeded maximum usage (60G)"
  },
  {
   "plan-id": "13000005",
   "name": "5G data 180 plan",
   "amount": "$48",
   "data": "180G limited",
   "comment": "Speed will be reduced when exceeded maximum usage (180G)"
  },
  {
   "plan-id": "14000006",
   "name": "5G+ data 220 plan",
   "amount": "$50",
   "data": "220G limited",
   "comment": "Speed will be reduced when exceeded maximum usage (220G)"
  }
 ]
}

5. **** Stay with the GET request method.

6. 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.

7. Enter an error message that will be displayed to the customer.

Sorry, I am terminating the session.

8. Keep the Mapping toggle on.

9. Enter a Key and JSONPath pairing for Result Mapping.

KEY plan_list

JSONPATH $.plan-list

10. Enter the template to show to the customer as a response.

These are the mobile plans.
{{#plan_list}}

  {{plan-id}}: ({{name}})
  {{amount}}: {{data}}
  {{comment}}

{{/plan_list}}

11. Click Save.

12. Click Publish to publish the Subject.

13. 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, I want to see mobile plans.

\

Last updated