Output Demo

Introduction

This adapter displays all the types of answers and outputs available in the Chatbot SDK.

This is intended for development purposes only. You can use it to see the design changes that apply to every type of answer and output.

Important: This adapter blocks the Inbenta API call.

Available Chatbot Answers

Caution: If you want to use these adapters "as is" in production environments, you must copy and use them from your servers.

Possible outputs:

The user can ask for the following outputs:

  • multiple - Displays a multipleChoiceQuestion.
  • polar - Displays a polar question.
  • system - Displays a system message, with and without buttons.
  • side window - Displays an answer with a side window.
  • media - Displays a media type answer(attachment).
  • related - Displays an answer with related contents.
  • show upload - Shows an upload attachment button.
  • hide upload - Hides the upload attachment button.
  • agent - Shows the activity as an agent joined the chat.
  • default - Shows the default agent activity.
  • hide activity - Hides the activity
  • system modal - Displays a systemMessage with the modal=true
  • custom window - Creates a custom window.
  • federated search - Displays a chatbotMessage with a search like answers
  • federated km - Displays a chatbotMessage with a search like answers
  • rating - A chatbotMessage with a fake trackingCode
  • buttons list - ChatbotMessage with fieldType buttons
  • dropdown - ChatbotMessage with fieldType dropdown

Adapter code and public Github repository

In the following code you have mocked up several types of answers, to see the full adapter, please refer to Github DemoMessages Adapter

Click here to see the mockup messages

Configuration:

Since there are several configurations available in the build method: Configurations, Inbenta recommends that you build the same configuration as the one used in your project.

Integration example:

  • In this particular instance, we will set ratings to see how they look, and we will display DateTime in every answer.
<!DOCTYPE html>
<html>
<head>
    <title>Demo</title>
    <script src="https://sdk.inbenta.io/chatbot/1/inbenta-chatbot-sdk.js"></script>

    <script src="messages-demo-adapter.js"></script>

    <script>
    var authorization = {
      domainKey:"<example_domain_key>",
      inbentaKey:"<example_inbenta_key>"
    }
      const config = {
          showDateTime: true,
          ratingOptions: [
            {
              id: 1,
              label: 'yes',
              comment: false
            },
            {
              id: 2,
              label: 'no',
              comment: true
            }
          ],
          adapters: [messagesDemoAdapter]
      };

      InbentaChatbotSDK.buildWithDomainCredentials(authorization, config)
    </script>
</head>