Reactions

Learn how to configure the way your bot reacts to user input. Validate input, resolve ambiguities, provide acknowledgements and suggestions.

reactions (optional)

Reactions define how NativeChat will react to a number of specified cases emerging from the value of the step’s entity. All reactions are processed before any step is executed.

ambiguities (optional)

There are cases where a bot can identify multiple values for a given entity, and it will use the message to ask the user which one is correct.

Ambiguity reaction example.

In the example below, a user could have asked the question “Is Dr. John Burke or Dr. Stan Smith a better doctor?”, and unless you have a conversation about comparing doctors, the bot will use the ambiguities message along with autogenerated quick replies to identify the correct one.

{
  "steps": [
    {
      "type": "question",
      "entity": "selectedDoctor",
      "entity-type": "Doctor",
      "messages": [
        "What's the name of the doctor that you want to see?"
      ],
      "display": {
        "type": "quick-reply",
        "data-source": {
          "endpoint": "https://yourwebsite.com/GetDoctors",
          "method": "GET"
        },
        "template": "{{Title}} {{FirstName}} {{LastName}}"
      },
      "reactions": {
        "ambiguities": [
          "I am not sure I understand the doctor you want to meet. Can you select one of the following?"
        ]
      }
    }
  ]
}

acknowledgments (optional)

A set of messages for informing the user that the bot has understood a specific value. It will be used only when the bot identifies the entity without explicitly asking for it. For example, if the user start the conversation with a long message, and the bot identifies both the correct conversation and some of the entities (doctor, location, time), it will send the acknowledgment messages for each of these entities to the user, so that the user gets a confirmation that the bot has understood him.

Acknowledgement reaction example.

{
  "steps": [
    {
      "type": "question",
      "entity": "selectedDoctor",
      "entity-type": "Doctor",
      "entity-display": "{{selectedDoctor.Title}} {{selectedDoctor.FirstName}} {{selectedDoctor.LastName}}",
      "messages": [
        "What's the name of the doctor that you want to see?"
      ],
      "display": {
        "type": "quick-reply",
        "data-source": {
          "endpoint": "https://yourwebsite.com/GetDoctors",
          "method": "GET"
        },
        "template": "{{Title}} {{FirstName}} {{LastName}}"
      },
      "reactions": {
        "acknowledgements": [
          "I understand that you want to meet with {{selectedDoctor}}."
        ]
      }
    }
  ]
}

validations (optional)

Read more about configuring validations

suggestions (optional)

It is used to suggest to the user some values for the entity, based on previous conversations. The suggestions reaction is only supported for steps that have no display at all or have quick-reply type of display.

Configure Suggestions.