Mind Expression Docs
English
  • Mind Expression Docs
  • Why Mind Expression
  • Quickstarts
    • Create Scope
    • Add Subject
    • Test
    • Audit
  • Concepts
    • Scopes
    • Subjects
    • Components
    • Sandbox
    • Conversation history
    • Webhooks and escalation
    • Knowledge
    • Live Chat
    • Target Messages
    • Analytics
  • How-to Guides
    • Set up webhooks and escalation
    • Manage global keys
    • Customize messages
    • Educate AI
      • Manage ontologies
      • Recognition Check
      • Semantic Relations
      • Manage entities
    • Steps
    • Components
      • Normal Components
        • Conditions
        • Selection Classes
        • Parameter Bundles
      • Response Components
        • Component Actions
    • Build Q&A Subjects
      • Case 1. Online Payment
      • Case 2. Data Plans
    • Build Info Search Subjects
      • Case 1. Data Usage
      • Case 2. Payment History
    • Build Query Freestyle Subjects
      • Case 1. Data Purchase
      • Case 2. Change Mobile Plan
    • Intelligent Process
      • Introduction to Mindscript
      • Mindscript with Mind Expression
      • Frequently Asked Question
      • Package: Collections and Sequenceable
      • Package: Collections Unordered
      • Package: Collections-Strings
      • Package: Engine-Conversation
      • Package: Kernel-HTTP
      • Package: Kernel-Methods
      • Package: Kernel-Numbers
      • Package: Kernel-Dates
      • Package: Kernel-Objects
      • Package: Kernel Exceptions
      • Package: Cryptography
    • Test and debug
    • Integration
      • Mind Expression API
      • Chat Widget
      • LINE
      • Facebook Messenger
      • Viber
      • Instagram
      • Discord
      • WhatsApp
      • Google Sheet
        • Google Sheet Webhook
      • Google Calendar
        • Google Calendar Webhook
        • Google Calendar: Use Cases
    • Audit AI Activities
    • Live Chat
    • Target Messages
    • Back up, import and restore Scopes
  • Reference
    • Glossary
    • API Docs
Powered by GitBook
On this page
  • Before you begin
  • Add a Subject
  • Build the Subject

Was this helpful?

  1. How-to Guides
  2. Build Q&A Subjects

Case 2. Data Plans

PreviousCase 1. Online PaymentNextBuild Info Search Subjects

Last updated 2 years ago

Was this helpful?

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.

\