Pages

Friday, April 13, 2018

Using Response Next to Define Conversation Flows

Bot Libre 6.5 added support for define isolated conversation flows through using the response "Next" elements.

The next is a follow-up question that the user might ask after the bot gives the response. For example, if you had a response to the question "help" as "Do you want help with web or mobile?", then if the user responded with "web", that would be a follow-up question. Previously these could be defined using "Previous" elements, or using Self scripting. Using next provides a better option that is more powerful than previous, and easier to use than scripting.

A next question can be defined when adding or editing a response from your bot's Training & Chat Logs page. Click on the "show" next checkbox to enable the next input in the response editor.

After you enter the next question and click save, the next question will appear below the response in the response browser. Click on the checkbox before the next question to edit the next and define its response (and optionally another next for a nested dialog). You can add multiple next question to a single response. The response's next question form an isolated conversational context.

If a response has a next question, the bot will only choose a response from the response's next, it will not consider any other responses. The bot will find the best matching next question, otherwise use the default response. To enter a default next response, enter the question as #default.

You can nest next questions and responses to easily form complex conversations. Next question form an isolated and inherited conversational space. Each nested next level can define its own default response, but if it does not, then the bot will consider responses from the parent level, or use the parent default response.

Example Next Conversation
question: help
response: Do you want help with <button>web</button> or <button>mobile</button>
keywords: help

    question: web
    response: Is you issue with <button>HTML</button> or <button>JavaScript</button>?

        question: html
        response: See https://www.w3schools.com/html

        question: javascript
        response: See https://www.w3schools.com/js

    question: mobile
    response: Are you using <button>Android</button> or <button>iOS</button>?

        question: android
        response: See https://www.android.com

        question: ios
        response: See https://developer.apple.com/ios

    question: quit
    response: Okay. Let me know if you need further help.

    default: Please specify <button>web</button> or <button>mobile</button>, or type <button>quit</button> if you do not need help.

The above example using the response list format, which can be imported or exported from the Training & Chat Logs page. To define a next question add a tab to indent the next question and response. Using multiple tabs allows next to be nested.

The next questions are shown in the response browser as a set of nested tables so you can easily visualize the entire conversation. You can edit or delete next questions and response from the response browser.

No comments:

Post a Comment