Q&A
  • 16 May 2024
  • 1 Minute to read
  • PDF

Q&A

  • PDF

Article summary

QnA is specifically designed to simplify how to handle frequently asked questions. It adds more responsiveness to your chatbot. You need to add at least ten different training phrases. Then you add at least one answer: plain text or any other content type.

Note:
You can also redirect a user to a specific node and workflow as a response to the question.

Create a Context

  1. Access Workbench.
  2. Click Q&A from the left menu.
  3. Click at the top right of the page. This will create a new Q&A.
  4. Under Contexts, type the context you want to add.

You can alternatively create a context as follows:

  1. Create a context specific to:
    1. one chatbot, create or edit this file data/bots/<your_bot>/config/qna.json.
    2. all chatbots, create or edit this file data/global/config/qna.json.
  2. Append the name of your new contexts to qnaCategories as follows:
    {
      "$schema""../../../assets/modules/qna/config.schema.json",
      "qnaCategories""global,monkeys,giraffes"
    }{
      "$schema""../../../assets/modules/qna/config.schema.json",
      "qnaCategories""global,monkeys,giraffes"
    }
Note:

Contexts listed in the dropdown menu are sourced from all your existing content (questions & NLU intents). The qna.json configuration file is no longer used to provide a list of contexts.

Figure: Create new Q&A

Add a Q&A

Once you have created your contexts, you can create your Q&As and assign a context to them. From the category menu, choose one of your contexts:

Figure: Add Q&A

Add Contexts to your Flow

The final step is to set the desired context at the appropriate time in your flow. To help you with this, we added 3 built-in actions (e.g., appendContext, resetContext and removeContext), under the NLU category in your actions list.

Append Context

To set a context, use the appendContext action and add your new context in the contexts field. You can use comma-separated values to pass multiple contexts.

Figure: Append Context

Time-To-Live (TTL)

The TTL or Time-To-Live field is used to set a maximum number of interactions for this context to exists within a conversation.

Example:

Take Welcome Bot for instance. Its contexts have a TTL of 10. This means that someone can ask up to 10 questions about animals before the context is ignored. After the TTL expires, the chatbot will fall back to the global context.


Was this article helpful?

Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.