NAV Navbar

How To / Tutorials

-A triniti Guide

Overview

This tutorial walks you through the process of building a workspace from scratch. It also provides you the best practices in designing a workspace.

Manage Your Account

Account Setup

Signup for a New Account

You can register to triniti.ai by following these steps.

  1. Open URL: https://developer.triniti.ai/
  2. Click on the “Create Account” link.
  3. Enter First name, Last name, Email id, Mobile number & your desired password. (CreateAccount1.png) (CreateAccount2.png) ... (Note: All fields are mandatory)
  4. Password should be
  1. Click on the “Create Account” button.
  2. An email notification will be sent to the registered email address.(CreateAccount3.png)(CreateAccount4.png)
  3. Access your registered email & click on the “Verify Email” button.
  4. Verification will be completed successfully & the Home page will be displayed. (CreateAccount5.png)

At the moment, we accept only sign ups using corporate email addresses. Triniti portal does not recognise emails created via free service such as example@gmail.com, example@yahoo.com or any other similar Id.

While creating your password, make sure to make it at least eight characters long with at least one special character.

A verification email will be sent to the email address you have used, to create your triniti account. Open the email and follow the instructions given to complete creating your account. This will lead you to the Triniti website’s home page.

Congratulations. You have created your first triniti account!

We are so happy to welcome you onboard. Eagerly looking forward to collaborate and grow along with you!

Login to your triniti account

If you already have an account, select the ‘login’ button on top where it reads "Already have an account? Login"

Recover your Triniti account

To recover your triniti account,

An email will be sent to your mail address. Follow the instructions given in the email to recover your triniti account.

  1. Open a browser on your laptop/desktop.
  2. Enter the URL & press enter.
  3. Click on the “Recover Account”
  4. Enter your registered email address & “Send email” button.(RecoverAccount1.png)

Create Your First Workspace

Workspace as the name indicates, is a space that triniti provides you for you to do the bot building process. It is similar to a digital folder that you will be provided with, upon purchase to start with building your bot.

Before you could start, make sure you have a Triniti.ai account. If you do not have an account, go to triniti’s login page and create an account.

This section describes how to create and try out your first triniti.ai workspace.

Create Workspace

Refer to (project types)[#projecttypes] to understand each of its features.

Depending on the plan you choose, the costs may vary. Look into the (pricing section)[#pricingsection] for details.

Once you have chosen your plan, go ahead and create your first workspace by selecting the ‘Create Workspace’ button.

Congratulations!!! You have now created your very first workspace !!!

Manage Your Workspace

Manage users for a Workspace

workbook

workbook

workbook

workbook

workbook

Delete a Workspace

workbook

workbook

Manage Settings

workbook

workbook

Manage Messages

workbook

workbook

workbook

Manage FAQ

Adding New FAQ's

How to setup FAQ (import from excel, csv or from website URL)?

  1. Click on workshop name, and import the FAQ to Train
  2. On Importing the File, the list of Added FAQ is shown in the FAQ page
  3. On importing from URL, copy paste the website FAQ page URL
  4. Select Import button (ImportFAQ1.png)

How to change the FAQ response format?

  1. Add New question in user asks field, add the answer in Bot Answer field and select default channel.
  2. Click on Add Question Set. (FAQResponseFormat1.png)
  3. Click on Change format to view different available formats. (ImportFAQ3.png)

A. Plain Text:

B. Buttons:

C. Carousel / List:

D. Image:

E. SSML:

How to add Quick replies:

How to add Smalltalk?

a. Select Smalltalk option from the left menu b. Click on view to edit the answer. (SmallTalk1.png)

How to set the minimum confidence score?

We can set the Minimum confidence score to get the answers from bot. If user utterances are less than the minimum confidence score configured then then error message will be displayed.

a. Select the Setting icon image displayed beside bot in left menu. b. Select General tab. c. Set minimum confidence score as 65. d. Configure “Default Error” message from messages tab. (General1.png) (General2.png) (General3.png)

How to customise websSDK?

We can customise the webSDK look and feel.

a. Select “Channels” from left menu b. Select the “Settings” icon displayed in webSDK channel. (Channel1.png) (Channel2.png) (Channel3.png)

How to embed webSDK into website?

Import the reference to the sdk.js from morfeuswebsdk public site in your hosted main html page where you intend the chat bot to render.

<script type="text/javascript" src="https://ai.yourcompany.com/morfeuswebsdk/libs/websdk/sdk.js" id="webSdk"></script>

Code Snippet?

Invoke the SDK by adding the code snippet

(function() {
  var customerId = "";
  var appSessionToken = "";
  var initAndShow = "1";
  var showInWebview="0";
  var endpointUrl = https://ai.yourcompany.com/morfeus/v1/channels"; 
  var desktop = {
      "chatWindowHeight": "90%",
      "chatWindowWidth": "25%",gs
      "chatWindowRight": "20px",
      "chatWindowBottom": "20px",
      "webviewSize": "full"
  };
  var initParam = {
        "customerId": customerId,        
        "desktop": desktop,            // screen Size of the chatbot for desktop version
        "initAndShow": initAndShow,     // maximized or closed state .
        "showInWebview": showInWebview,
        "endpointUrl": endpointUrl,
        "botId": "XXXXXXXXXXXXX",             // unique botId Instance specific
        "domain": "https://ai.yourcompany.com",    // hosted domain address for websdk
        "botName": "default",
        "apiKey": "1234567",
        "dualMode": "0",
        "debugMode": "0",
        "timeout": 1000 * 60 * 15,
        "idleTimeout": 1000  * 60 * 15,
        "quickTags" : {
          "enable" : true,
          "overrideDefaultTags" : true,
          "tags" : ["recharge","balance", "transfer", "pay bills"]
        }
    }
 window.options = initParam;
 websdk.initialize(initParam);
})();
options descriptions default
botName The name of the bot
desktop The chat dimension configuration for desktop browsers refer to the above sample code
endpointUrl The bot API URL “"
customerId The unique id for handling session “"
domain The domain part of the url of the host webapp with the protocol “"
destroyOnClose removes the websdk instance when the close button is clicked FALSE
initAndShow open the chat window when sdk is initiated 1
version websdk version used 1.3.10

Integration on morefeuwebsdk

<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta http-equiv="X-UA-Compatible" content="ie=edge">
        <title>Chatbot</title>
        <style>
            #chatbot {
                bottom: 0;
                right: 0;
                width: 435px !important;
                height: 100%;
                position: absolute;
            }
        </style>
    </head>

    <body>
        <iframe id="chatbot" frameborder="0" scrolling="no" allow="microphone" src="https://ai.yourcompany.com/morfeus/"></iframe>
    </body>
</html>

List Of Customisable Features:

Feature Is Customisable How
Common Templates Yes Common Templates can be customised by writing css in vendor-theme-chatbox.css and vendor-theme-chatbox.css.
Customer Specific Templates Yes Common Templates can be customised by writing css in vendor-theme-chatbox.css a

nd vendor-theme-chatbox.css.

Feature Is Customisable How
Icons Yes Icons can be customised by replacing icons references in index.css and common

templates.

Feature Is Customisable How
Minimize Button Yes The minimise button can be customised by changing it's image reference in desktopHeaderTemplate.html and mobileHeaderTemplate.html in common templates and it's style values in vendor-theme-chatbox.css.
Close Button Yes The close button can be customised by changing it's image reference in desktopHeade

rTemplate.html and mobileHeaderTemplate.html in common templates and it's style values in vendor-theme-chatbox.css. Maximize Button | Yes | This feature can be introduced in the websdk by providing a flag in index.js of the project.And can be customised by making changes in minimizedStateTemplate.html in common templates and style values in vendor-theme-chatbox.css.

The flag that needs to be introduced in initParams of index.js of project is json "minimizedState : false".

Feature Is Customisable How
Splash Screen Yes Modify the splashScreenTemplate.html available in the common templates. Customize this template according to the requirement by adding style(css) in vendor-theme-chatbox.css.
Feature Is Customisable How
Popular Query - This feature displays a menu at the footer of the chatbot showing popular querieswhich could made by the user to the bot. Yes Can be customised by changing the display type of submenu in the payload coming in the init call.
Feature Is Customisable How
Prelogin No Default feature. No customisation needed.
Postlogin Yes Postlogin case is a scenario where the user is already logged in the parent app(bank's application). So morfeus-controller have to pass X-CSRF-TOKEN in init request to ensure it's a postlogin case.
Feature Is Customisable How
Analytics - This feature is about adding analytics management to the websdk container. Yes This feature can be enabled/disabled in websdk by adding/removing analytics flag object in initParams config object of index.js of the project. Below is the config structure to be added Type of the values to be added in the above object
"analytics" : {
    "enabled" : true/false,
    "crossDomains" : [domain 1, domain 2, ...domain n],
    "ids" : {
        "analyticsServiceProviderName" : "apiKey"
    }
}
Feature Is Customisable How

DestroyOnClose - This feature is about destroying the instance of the bot completely from the parent page containing the chatbot | Yes | This feature can be enabled/disabled in websdk by adding/removing destroyOnClose flag in initParams config object of index.js of the project. Below is the flag to be added -

destroyOnClose : true/false
Feature Is Customisable How
Quick Tags - This feature is used to add quick replies list in the chatbot. This usually comes in the bottom section of the chatbot. Yes This feature can be enabled/disabled in websdk by adding/removing quickTags flag object in initParams config object of index.js of the project. This feature can further be customised by changing the payload coming in the init network call after the bot is rendered

inorder to load quick tag options dynamically from the server. Also if the overrideDefaultTags is set to false, The quickTags can be modified from server response quick_replies, an d if the response from the server is empty, the quickTags will loaded from index.js

Below is the flag object to be added -

"quickTags" : {
    "enabled" : true/false,
    "overrideDefaultTags" : true/false,
    "tags" : ["tag1", "tag2"...."tagn"]
}
Feature Is Customisable How
Start Over Chat - This feature is used reinitiate the chatbot by clearing all the current session chat messages if required and current user login session as well Yes This feature can be enabled/disabled in websdk by adding/removing startOverChat flag object in initParams config object of index.js of the project. Below is the flag object to be added -
"startOverConfig" : {
    "clearMessage" : true/false
}
Feature Is Customisable How
Idle timeout - This feature logs out the user after a certain period of time if the user is logged in and is inactive for a certain period of time Yes The idle timeout in websdk can be changed by changing the value of idletimeout flag in

initParams config object of index.js of the project. Below is the flag to be added -

"idletimeout" : 'idleTimeoutValue'
Feature Is Customisable How
Bot Dimension - This feature is used to specify the dimensions of the chatbot in parent container. Yes The dimension and position of chatBox window inside the parent container window can be managed by providing desktop flag object in the initParam config object. Below is the flag to be added -
"desktop" : {
    "chatWidth" : "value in %",
    "chatHeight" : "value in %",
    "chatRight" : "value in px",
    "chatBottom" : "value in px"
}
Feature Is Customisable How
Upload Image - This feature is used to upload user's image in the chatbox. Yes (only style) The is only customisable in look and feel wise by making changes in chatBoxTemplate

.html's editImage modal in common templates.

Feature Is Customisable How
Teach Icon Yes The icon can be changed by replacing with the desired image in images folder of the project and replacing with appropriate image and making changes in the feedbackTemplate.html of common templates
Feedback Icons Yes The icon can be changed by replacing with the desired images in images folder of the project and replacing with appropriate images and making changes in the feedbackTemplate.html of common templates
Feature Is Customisable How
Date Format - This feature is about keeping a particular date format when chatbot is showing last login date to the user Yes It can be changed by keeping a flag lastLoginDateFormat in initParams object of the index.js file of projects. Below is the flag to be added -
lastLoginDateFormat : "date format in string"
Feature Is Customisable How
Emoji - Supporting emojis in websdk as a feature Yes 1.This feature can be enabled/disabled in websdk by adding/removing a flag called emojiEnabled in initParams config object of index.js of project. 2.And the different emojis supported in websdk can be mentioned in the emoji array flag where each element contains an array of emoji's. This also has to be added in initConfig params object of index.js of project. The mark up and style values and of the emoji box can be changed by customising emojiTemplate.html in common templates and vendor-theme.chatbox.css respectively.

For Point 1

Below is the flag to be added - json enableEmoji : true/false

For Point 2

Below is the flag to be added - ``` emoji : [ ["emoji code1","emoji code2","emoji code3" ....."emoji code n"],

["emoji code1","emoji code2","emoji code3" ....."emoji code n"],

.

.

["emoji code1","emoji code2","emoji code3" ....."emoji code n"] ] ```

Feature Is Customisable How
SSL Pinning - This feature is implemented on the mobile implementation of websdk. It is a security check for certificates on network calls Yes This feature can be enabled/disabled in websdk by adding/removing a flag called sslE nabled in initParams config object of index.js of project. Below is the flag to be added -
sslEnabled : true/false
Feature Is Customisable How
Server Sent Event Feature - This feature is implemented when the chatbot is unable to continue chat with user further and chat is transferred to a human being No
Feature Is Customisable How
Push Notification - This feature is used to send push notification updates to the user Yes This feature can be enabled/disabled in websdk by adding/removing a flag called pushConfig object in INIT_DATA object through admin panel of morfeuswebsdk.
Feature Is Customisable How
AutoSuggest - This feature is used to present suggestions to user whenever user is typing a query in the chatbox. Yes This feature can be enabled/disabled in websdk by adding/removing a flag called autoSuggestConfig object in INIT_DATA object through admin panel of morfeuswebsdk.

Below is the sample config to be added json "autoSuggestConfig" : { "enableSearchRequest" : true/false, "enabled" : true/false, " noOfLetters" : number } Feature Is | Customisable | How |---|---|---|---|---| VoiceSdk - This feature is used for mic support in hybrid sdk for mobile based platforms | Yes | This feature can be enabled/disabled in websdk by adding/removing a flag called voiceSdkConfig object in INIT_DATA object through admin panel of morfeuswebsdk. Below is the sample payload config to be added ```json "voiceSdkConfig" : { "enableVoiceSdkHint" : true/false, "maxVoiceSdkHint" : number of hints, "speechConfidenceThreshold" : threshold value

} ```

Feature Is Customisable How
Custom Webview Header - Used to insert customised Webview Header Template. Yes This feature has template dependency which can be customised by changed webviewHeaderTemplate.html from common templates and css style from vendor-theme-chatbox.css. This feature can be enabled/disabled in websdk by adding/removing a flag called customWebviewHeader in initParams config object of index.js of project. Below is the flag object to be added in initParams Config Object-
"customWebviewHeader" : {
    "enable" : true/false
}
Feature Is Customisable How
Show Postback Utterance - This feature is used trigger external message in websdk from parent container. Yes This feature can be enabled/disabled in websdk by adding/removing a flag called showPostbackUtterance in initParams config object of index.js of project.

Below is the flag to be added in initParams Config Object-

"showPostbackUtterance" : true/false

Type of value to be added in the above flag

showPostbackUtterance : Boolean

Feature Is Customisable How
Custom Errors - This feature is used to handle various network response error scenarios in websdk. Yes This feature can be enabled/disabled in websdk by adding/removing a flag called customErrors in initParams config object of index.js of project. For various HTTP error statuses, project can define different messages in a function called handleErrorResponse of preflight.js file. Below is the flag to be added in initParams Config Object-
"customErrors" : true/false
Feature Is Customisable How
Hide On Response - This is feature is used to minimise chatbot when user is having conversation with the bot depending upon the template type coming from the network response Yes This feature can be enabled/disabled in websdk by adding removing a flag called hideOnResponseTemplate in initParams config object of index.js of project. Below is the flag to be added in initParams Config Object-
"hideOnResponseTemplates" : ["templateName1",
"templateName2",...."templateName n"]
Feature Is Customisable How
Show Close Button On Postlogin - This feature is used to remove close button in post login scenario. Yes This feature can be enabled/disabled in websdk by adding/removing a flag called showCrossOnPostLogin in initParams config object of index.js of project. Below is the flag to be added in initParams Config Object-
"showCrossOnPostLogin" : true/false
Feature Is Customisable How

Location Blocked Message - This is used to display custom location blocked message if user has denied allow location pop up in browser Yes This feature can be enabled/disabled in websdk by adding/removing a flag called locationBlockedMsg in initParams config object of index.js of project. Below is the flag object to be added in initParams Config Object- json "locationBlockedMsg" : true/false

Feature Is Customisable How
Slim Scroll - This feature is used to enable slim scroll bar for Internet Explorer browser Yes This feature can be enabled/disabled in websdk by adding/removing a flag called enableSlimScroll in initParams config object of index.js of project. Below is the flag object to be added in initParams Config Object-
"enableSlimScroll" : true/false
Feature Is Customisable How
Unlinkify Email - This feature is used to remove url nature of any emails text coming in websdk cards Yes This feature can be enabled/disabled in websdk by adding/removing a flag called unLinkifyEmail in initParams config object of index.js of project. Below is the flag object to be added in initParams Config Object-
"unLinkifyEmail" : true/false
Feature Is Customisable How
Focus On Query - Focus on input box if the last message in websdk is a text Yes This feature can be enabled/disabled in websdk by adding/removing a flag

called focusOnQuery in initParams config object of index.js of project. Below is the flag object to be added in initParams Config Object- json "focusOnQuery" : true/false

Feature Is Customisable How
Custom Negative Feedback - Load an dynamic feedback template from network call rather than default feedback modal Yes m This feature can be enabled/disabled in websdk by adding/removing a flag called customNegativeFeedback in initParams config object of index.js of project. Below is the flag object to be added in initParams Config Object-
"customNegativeFeedback" : true/false
Feature Is Customisable How
If payload type is RELATED_FAQ and messageType in network request body needed is postback Yes This feature can be enabled/disabled in websdk by adding/removing a flag called postbackOnRelatedFaq in initParams config object of index.js of project. Below is the flag object to be added in initParams Config Object-
    "postbackOnRelatedFaq" : true/false

Managing KeyPhrases

Handling Unknown Words

Formatting FAQ Responses

Redirecting FAQ's to Workflows

Setting up Channel Specific Responses

Handling Ambiguity

Managing FAQ Settings

Fine Tuning FAQ's

Define Intents

Adding Intents

workbook

workbook

workbook

Annotating & Linking Entities

Pending

Importing & Exporting Intents

workbook

-System will display intents imported successfully after deployment.

-workbook

workbook

Manage Dialogs

Define Entities

Adding Entities

  1. Click on workspace.
  2. Click on Entities option.
  3. Click on + add Entity button.
  4. Enter entity name, entity value and chose type of entity.
  5. Click on save button on right corner to save.

Managing Dictionary Entities

  1. Click on workspace.
  2. Click on Entities option.
  3. Click on delete button to delete entities from our workspace.
  4. Click on save to save our changes.

Managing XXX Entities

Pending

Importing & Exporting Entities

  1. Click on workspace.
  2. Click on Entities option.
  3. Click on export or import icons at the right corner to import / export entities.
  4. Click on save button after importing.

Default Entities

Pending

Manage Small Talk

Define Acronymns

Manage Fullfillment via Webhooks

Defining a Webhook

Webhook Signature

Conversational Workflow Framework

Handling Responses

Manage Fullfillment via Workflows

Workflow Editor Description

The Workflow Editor as the name suggests is a GUI to create/edit a new/existing workflow.

Workbook

A workbook is where you will design the complete flow for a particular intent. Each workbook can have multiple nodes to define the flow. The figure below shows a new workbook only with a Start node and the toolbar. workbook

Toolbar

Toolbar exists in the top right corner of the workflow editor, which comprise of

fulscreen Full Screen: To make the editor occupy full screen or go back to the normal window.

download Download: To downloads the AIFlow file. The AIFlow file can be imported for other intent or in the other workspace.

upload Upload: This can be used in case a pre-designed AIFlow file is available and needs to be uploaded to show a workflow in the editor.

debug Debug Workflow: To view the source code of the AIFlow file and JSON workflow. For debugging purpose.

save Save Workflow: To save the workflow.

Node

Node is one step of the process to complete a flow. Each node is attached to one entity. And every node has three responsibilities.

  1. Ask input from the user
  2. Verify inputs
  3. To route to next step

Each node except the start node has four buttons on the right-hand side upper corner to open Definition, Validation, Connection and to delete. For the start node, there is no Validation. This tiny “garbage can” icon on every node enables the user to selectively delete a particular node.

node

Definition

This category contains the following keys (as can be seen from the attached fig below) :

- Node name: name of the node
- Node description: a brief description of what the node does
- The entity to be handled by the node
- Keyboard State: A hint to the client SDK what kind of input is expected from the user.
- Prompt: Messages to send to the user to ask for the entities.
definition

Validation

This category contains the keys participating in the validation of user inputs:

- Validation Type: defines the type of validation of the user inputs e.g. regex validation, camel route validation etc.
- Login session required: if checked, the key secured in JSON is set to true, meaning that the user will have to be logged in as part of validation for this node.
- End flow if Validation Fails: if checked, the flow will end altogether in case the validation of the current node fails.
- Error Prompt: this static error text message is displayed if the user fails the validation. This error message will be added in outputs[] of the JSON with “id”=“error”.
validation

Connection

This section can be configured to have conditional branching to another node and is reflected in the script section of the input definition in JSON.

connection

Defining a Workflow

Configuring a Workflow

Handling Validations

Business Logic via Webhooks

Scripting via Javascript

Scripting via Groovy

Conversation Model Reference

Handling Responses

Debugging Workflows

Manage Channels

Managing Web & Hybrid

Customizing Web & Hybrid Channels

Managing Facebook Messenger

Managing Line

Managing Telegram

Managing Viber

Managing Slack

Managing Skype

Managing Skype for Business

Managing Slack

Managing Cortana

Managing Alexa

Managing Google Assistant & xx

Managing Twilio

Managing AWS Connect

Managing Twilio XXX

Managing Jio

Managing Livebank

Managing WeChat

Managing Authentication for Social Channels

Managing Authentication for IOT Channels

Managing Android

Overview

Android SDK provides a lightweight conversational / messaging UX interface for users to interact to the Triniti Platform. The SDK enables rich conversation components to be embedded in existing Android Mobile Apps.

Pre Requisites

Install and configure dependencies

Download SDK

Download the Morfeus SDK from the given URL or other channels communicated to you. Extract MorfeusAndroidSDK_Hybrid.zip file which you have downloaded.

Add SDK to your Android Studio project

  1. Open your application's Android Studio project.
  2. Copy MFSDKHybridKit.aar file to project's app/libs folder.
  3. Create a new libs folder under app directory if it does not exist.
  4. Add the following dependencies to your app level build.gradle file.
dependencies {
...
// Voice SDK
compile ('com.morfeus.android.voice:MFSDKVoice:1.1.3')
// gRPC
compile 'io.grpc:grpc-okhttp:1.13.1'
compile 'io.grpc:grpc-protobuf-lite:1.13.1'
compile 'io.grpc:grpc-stub:1.13.1'
compile 'io.grpc:grpc-android:1.13.1'
compile 'javax.annotation:javax.annotation-api:1.2'

// OAuth2 for Google API
compile('com.google.auth:google-auth-library-oauth2-http:0.7.0') {
exclude module: 'httpclient'
}
compile(name: 'MFSDKHybridKit', ext: 'aar')
compile 'com.google.guava:guava:20.0'
compile 'com.android.support:appcompat-v7:25.0.0'
...
}
repositories {
flatDir {
dirs 'libs'
}
}

Note:If you get 64k method limit exception during compile time then add following code into your app-level build.gradle file.

android {
defaultConfig {
multiDexEnabled true
}
}
dependencies {
compile 'com.android.support:multidex:1.0.1'
}

Add the following lines to your project level build.gradle file.

allprojects {
repositories {
google()
jcenter()
maven {
   url "http://artifacts.active.ai/artifactory/android-sdk-release"
   credentials {
       username = "artifactory_username"
       password = "artifactory_password"
   }
}
}
}

Initialize the SDK

To initialize Morfeus SDK pass given BOT_ID, BOT_NAME and END_POINT_URL to MFSDKMessagingManagerKit. You must initialize Morfeus SDK once across the entire application.

Add following lines to your Activity/Application where you want to initialize the Morfeus SDK.onCreate()of Application class is best place to initialize. If you have already initialized MFSDK, reinitializing MFSDK will throw MFSDKInitializationException.

try {
// Properties to pass before initializing sdk
MFSDKProperties properties = new MFSDKProperties
        .Builder(END_POINT_URL)
        .addBot(BOT_ID, BOT_NAME)
        .setSpeechAPIKey("YourSpeechAPIKey")
        .build();

// sMFSDK is public static field variable
sMFSDK = new MFSDKMessagingManagerKit
        .Builder(applicationContext)
        .setSdkProperties(properties)
        .build();

// Initialize sdk
sMFSDK.initWithProperties();

} catch (MFSDKInitializationException e) {
Log.e("MFSDK", e.getMessage());
}

Properties:

Property Description
BOT_ID The unique ID for the bot.
BOT_NAME The bot name to display on top of chat screen.
END_POINT_URL The bot API URL.

Above properties you can get through nevigating to Channels > Android click on settings icon.

alt_text

Invoke Chat Screen

To invoke chat screen call showScreen() method of MFSDKMessagingManagerKit. Here, sMSDK is an instance variable of MFSDKMessagingManagerKit.

// Open chat screen
sMFSDK.showScreen(activityContext, BOT_ID);

You can get instance of MFSDKMessagingManagerKit by calling getInstance()of MFSDKMessagingManagerKit. Please make sure before calling getInstance() you have initialized the MFSDK. Please check following code snippet.

try {
// Get SDK instance
MFSDKMessagingManager mfsdk = MFSDKMessagingManagerKit.getInstance();

// Open chat screen
mfsdk.showScreen(activityContext, BOT_ID);

} catch (Exception e) {
// Throws exception if MFSDK not initialised.
}

Compile and Run

Once above code is added you can build and run your application. On launch of chat screen, welcome message will be displayed.

alt_text

Providing User/Session Information

You can pass set of user/session information to the MFSDK using MFSDKSessionProperties builder. In following example we are passing Customer ID to MFSDK.

HashMap<String, String> userInfoMap      = new HashMap();
userInfo.put("CUSTOMER_ID", customerID);
userInfo.put("SESSION_ID", sessionID); // Pass your app sessionID

MFSDKSessionProperties sessionProperties = new MFSDKSessionProperties
                      .Builder()
                      .setUserInfo(userInfoMap)
                      .build();

// Open chat screen 
mMFSdk.showScreen(LoginActivity.this, BOT_ID,  sessionProperties);

Close chat screen with/without animation

To close the chat screen call closeScreen(String botId, boolean withAnimation)method of MFSDKMessagingManager with/without exit animation. Set second parameter to false to close screen without animation.

// Close chat screen without exit animation
sMFSdk.closeScreen(BOT_ID, false);

Enable voice chat

If you haven't added required dependencies for voice than please add following dependencies in your project's build.gradle file.

app/build.gradle

dependencies {
...
// Voice SDK dependencies
compile ('com.morfeus.android.voice:MFSDKVoice:1.1.3')
compile 'io.grpc:grpc-okhttp:1.13.1'
compile 'io.grpc:grpc-protobuf-lite:1.13.1'
compile 'io.grpc:grpc-stub:1.13.1'
compile 'io.grpc:grpc-android:1.13.1'
compile 'javax.annotation:javax.annotation-api:1.2'
compile('com.google.auth:google-auth-library-oauth2-http:0.7.0') {
exclude module: 'httpclient'
}
...
}

repositories {
flatDir {
dirs 'libs'
}
}

project/build.gradle

allprojects {
repositories {
google()
jcenter()
maven {
   url "http://artifacts.active.ai/artifactory/android-sdk-release"
   credentials {
       username = "artifactory_username"
       password = "artifactory_password"
   }
}
}
}

Call setSpeechAPIKey(String apiKey) method ofMFSDKProperties builder to pass speech API key.

try {
// Set speech API key
MFSDKProperties properties = new MFSDKProperties
        .Builder(END_POINT_URL)
        ...
        .setSpeechAPIKey("YourSpeechAPIKey")
        ... 
        .build();

} catch (MFSDKInitializationException e) {
Log.e("MFSDK", e.getMessage());
}

Set Speech-To-Text language

In MFSDKHybridKit, English(India) is the default language set for Speech-To-Text. You can change STT language by passing valid language code using setSpeechToTextLanguage("lang-Country")method ofMFSDKProperties.Builder. You can find list of supported language code here.

try {
// Set speech to text language
MFSDKProperties properties = new MFSDKProperties
        .Builder(END_POINT_URL)
        ...
        .setSpeechToTextLanguage("en-IN")
        ... 
        .build();

} catch (MFSDKInitializationException e) {
Log.e("MFSDK", e.getMessage());
}

Set Text-To-Speech language

English(India) is the default language set for Text-To-Speech. You can change TTS language by passing valid language code using setTextToSpeechLanguage("lang-Country") method of MFSDKProperties.Builder.You can find list of supported language code here.

try {
// Set text to speech language
MFSDKProperties properties = new MFSDKProperties
        .Builder(END_POINT_URL)
        ...
        .setTextToSpeechLanguage("en_IN")
        ... 
        .build();

} catch (MFSDKInitializationException e) {
Log.e("MFSDK", e.getMessage());
}

Provide Speech Suggestions

You can provide additional contextual information for processing user speech. To provide speech suggestions add list of words and phrases into MFSpeechSuggestion.json file and place it under assets folder of your project. You can add maximum 150 phrases intoMFSpeechSuggestion.json. To see sample MFSpeechSuggestion.json, please download it from here.

Enable Analytics

By default, analytics is disabled in SDK. To enable analytics set enableAnalytics(true) and pass analytics provider and id detail with MFSDKProperpties. Please check the following code snippet to enable analytics.

try {
// Pass analytics properties
MFSDKProperties properties = new MFSDKProperties
        .Builder(END_POINT_URL)
        ...
        .enableAnalytics(true)
        .setAnalyticsProvider("Your Analytics provider code")
        .setAnalyticsId("Your Analytics ID")
        ... 
        .build();

} catch (MFSDKInitializationException e) {
Log.e("MFSDK", e.getMessage());
}

Managing IOS

Overview

iOS SDK provides a lightweight conversational / messaging UX interface for users to interact to the Triniti Platform. The SDK enables rich conversation components to be embedded in existing iOS Mobile Apps.

Prerequisites

Install and configure dependencies

1. Install Cocoapods

CocoaPods is a dependency manager for Objective-C, which automates and simplifies the process of using 3rd-party libraries in your projects. CocoaPods is distributed as a ruby gem, and is installed by running the following commands in Terminal App:

$ sudo gem install cocoapods
$ pod setup

2. Update .netrc file

The Morfeus iOS SDK are stored in a secured artifactory. Cocoapods handles the process of linking these frameworks with the target application. When artifactory requests for authentication information when installing MFSDKWebKit, cocoapods reads credential information from the file.netrc, located in ~/ directory.

The .netrc file format is as explained: we specify machine(artifactory) name, followed by login, followed by password, each in separate lines. There is exactly one space after the keywords machine, login, password.

machine <NETRC_MACHINE_NAME>
login <NETRC_LOGIN>
password <NETRC_PASSWORD>

One example of .netrc file structure with sample credentials is as below. Please check with the development team for the actual credentials to use.

drawing

Steps to create or update .netrc file

  1. Start up Terminal in mac
  2. Type "cd ~/" to go to your home folder
  3. Type "touch .netrc", this creates a new file, If a file with name .netrc not found.
  4. Type "open -a TextEdit .netrc", this opens .netrc file in TextEdit
  5. Append the machine name and credentials shared by development team in above format, if it does not exist already.
  6. Save and exit TextEdit

3. Install the pod

To integrate 'MFSDKWebKit' into your Xcode project, specify the below code in your Podfile

source 'https://github.com/CocoaPods/Specs.git'
#Voice support is available from iOS 8.0 and above
platform :ios, '7.1'

target 'TargetAppName' do
pod '<COCOAPOD_NAME>'
end

Once added above code, run install command in your project directory, where your "podfile" is located.

$ pod install

If you get an error like "Unable to find a specification for ", then run below command to update your specs to latest version.

$ pod repo update

When you want to update your pods to latest version then run below command.

$ pod update

Note: If we get "401 Unauthorized" error, then please verify your .netrc file and the associated credentials.

4. Disable bitcode

Select target open "Build Settings" tab and set "Enable Bitcode" to "No".

alt_text

5. Give permission

Search for ".plist" file in the supporting files folder in your Xcode project. Update NSAppTransportSecurity to describe your app's intended HTTP connection behavior. Please refer apple documentation and choose the best configuration for your app. Below is one sample configuration.

<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>

6. Invoke the SDK

To invoke chat screen, create MFSDKProperties, MFSDKSessionProperties and then call the method showScreenWithBotID:fromViewController:withSessionProperties to present the chat screen. Please find below code sample.

// Add this to the .h of your file
#import "ViewController.h"
#import <MFSDKMessagingKit/MFSDKMessagingKit.h>
@interface ViewController ()<MFSDKMessagingDelegate>
@end

// Add this to the .m of your file
@implementation ViewController
// Once the button is clicked, show the message screen -(IBAction)startChat:(id)sender
{
MFSDKProperties *params = [[MFSDKProperties alloc] initWithDomain:@"<END_POINT_URL>"];
[params addBot:@"<BOT_ID>" botName:@"<BOT_NAME>"]; 
params.messagingDelegate = self;
[[MFSDKMessagingManager sharedInstance] initWithProperties:params];

MFSDKSessionProperties *sessionProperties = [[MFSDKSessionProperties alloc]init];
sessionProperties.userInfo = [[NSDictionary alloc] initWithObjectsAndKeys:@"KEY",@"VALUE", nil];
[[MFSDKMessagingManager sharedInstance] showScreenWithBotID:@"<BOT_ID>" fromViewController:self withSessionProperties:sessionProperties];
}

@end

Properties:

Property Description
BOT_ID The unique ID for the bot
BOT_NAME The bot name to display on top of chat screen.
END_POINT_URL The bot API URL

Above properties you can get through nevigating to Channels > iOS click on settings icon.

alt_text

Compile and Run

Once above code is added we can build and run. On launch of chat screen, welcome message will be displayed.

alt_text

Providing User/Session Information

You can pass set of key value pairs to the MFSDK using userInfo(NSDictionary) in MFSDKSessionProperties. In following example we are passing Customer ID, Session ID to MFSDK.

 MFSDKSessionProperties *sessionProperties = [[MFSDKSessionProperties alloc]init];
 sessionProperties.userInfo = @{@"CUSTOMER_ID": @"<CUSTOMER_ID_VALUE>", @"SESSION_ID": @"<SESSION_ID_VALUE>", nil];
 [[MFSDKMessagingManager sharedInstance] showScreenWithBotID:@"<BOT_ID>" fromViewController:self withSessionProperties:sessionProperties];

Retrieve Close Event

To retrieve close event, implement the MFSDKMessagingDelegate. MFSDK will call onChatClose method when user touches back button, which results in closure of chat screen.

Please check following code sample.

// Add this to the header of your file
#import "ViewController.h"
#import <MFSDKMessagingKit/MFSDKMessagingKit.h>
@interface ViewController ()<MFSDKMessagingDelegate>
@end
@implementation ViewController 
-(IBAction)startChat:(id)sender
{
    ...
    //Show chat screen
}

-(void)onChatClose
{
    NSLog(@"Chat screen closed, perform necessary action");
}
@end

Close Chat Screen

To close the chat screen without animation call closeScreenWithBotID:withAnimation: with the botId as first parameter and boolean value NO as second parameter.

 [[MFSDKMessagingManager sharedInstance] closeScreenWithBotID:@"<BOT_ID>" withAnimation:NO];

Enable voice chat

Provide Speech API Key

MFSDKWebKit supports text to speech and speech to text feature. The minimum iOS deployment target for voice feature is iOS 8.0. The pod file also needs to be updated with the minimum deployment target for voice feature. Speech API key can be passed using speechAPIKey in MFSDKSessionProperties as below.

   MFSDKSessionProperties *sessionProperties = [[MFSDKSessionProperties alloc]init];
...
   sessionProperties.speechAPIKey = @"<YOUR_SPEECH_API_KEY>";
...
  [[MFSDKMessagingManager sharedInstance] showScreenWithBotID:@"<BOT_ID>" fromViewController:self withSessionProperties:sessionProperties];

Search for ".plist" file in the supporting files folder in your Xcode project. Add needed capabilities like below and appropriate description.

<key>NSSpeechRecognitionUsageDescription</key>
<string>SPECIFY_REASON_FOR_USING_SPEECH_RECOGNITION</string>

<key>NSMicrophoneUsageDescription</key>
<string>SPECIFY_REASON_FOR_USING_MICROPHONE</string>

Set Speech-To-Text language

English(India) is the default language set for Speech-To-Text. You can change STT language by passing valid language code using speechToTextLanguage property of MFSDKSessionProperties. You can find list of supported language code here.

MFSDKSessionProperties *sessionProperties = [[MFSDKSessionProperties alloc]init];
   sessionProperties.shouldSupportMultiLanguage = YES;
   sessionProperties.speechToTextLanguage = @"en-IN";

Set Text-To-Speech language

English(India) is the default language set for Text-To-Speech. You can change STT language by passing valid language code using textToSpeechLanguage property of MFSDKSessionProperties.Please set language code as per apple guidelines.

MFSDKSessionProperties *sessionProperties = [[MFSDKSessionProperties alloc]init];
   sessionProperties.shouldSupportMultiLanguage = YES;
   sessionProperties.textToSpeechLanguage = @"en-IN";

Provide Speech Suggestions

You can provide additional contextual information for processing user speech. To provide speech suggestions add list of words and phrases into MFSpeechSuggestion.json file and add it to main bundle of your target. You can add maximum 150 phrases intoMFSpeechSuggestion.json. To see sample MFSpeechSuggestion.json, please download it from here.

Enable Analytics

By default, analytics is disabled in SDK. To enable analytics set enableAnalytics to YESand pass analytics provider and id detail with MFSDKProperpties. Please check the following code snippet to enable analytics

// Add this to the header of your file
#import "ViewController.h"
#import <MFSDKMessagingKit/MFSDKMessagingKit.h>
@interface ViewController ()<MFSDKMessagingDelegate>
@end
@implementation ViewController 
-(IBAction)startChat:(id)sender
{
    MFSDKProperties *params = [[MFSDKProperties alloc] initWithDomain:@"<END_POINT_URL>"];
    params.enableAnalytics = YES;
    params.analyticsProvider = @"YOUR_ANALYTICS_PROVIDER_CODE";
    params.analyticsId = @"YOUR_ANALYTICS_ID";
    ...    
    [[MFSDKMessagingManager sharedInstance] initWithProperties:params];
    ...
    //Show chat screen
}
@end

Train, Deploy & Publish your Workspace

Training your Workspace

Starting your Workspace

Publishing your Workspace

Manage Self Learning

Analysing the Report

Incorporating Intent Utterances

Incorporating Dialog Utterances

Incorporating SmallTalk Utterances

Incorporating FAQ Utterances

Manage Customers & Support

Analysing the Report

Customer Profile

Customer Conversation History

Manage Metrics

Manage Billing & Subscription

Setting up Payment Information

Invoice payment can be made through credit card or EFT( Electronic Funds Transfer)

alt_text

We accept Master, Visa and Amex type of credit cards.

alt_text

Workspace payment mapping. Each workpsace can be configured to used different credit cards.

alt_text

Charges

Charges can be configured on either per API or Slab wise. Charges can be configured differently for each plan.

Per API

Based on the total api usage , workspace charges will be calculated.

Slab

Managing Plans

We have the following paid plans whose charges will be differ.

Free Basic Premium

User can upgrade from FREE -> BASIC, BASIC -> PREMIUM but can't downgrade

alt_text

Managing Invoices

The Invoice will be generated on 1st of every month for the previous month workspace usage. Be default each workspace allocated a payment method (Primary credit card) and can be changed. Different invoices generated based on different payment methods.

For instance, there are three workspaces (A, B & C). Workspace A & B allocated a payment method say Visa Credit Card and workspace C allocated a payment method say Master Card. There will be two invoices one with Visa Credit Card - includes charges of workspaces A & B and another Master Credit Card for workspace C.

Respective credti card will be charged with the calculated invoice amount who details are in the invoice PDF.

If the payment fails for a credit card, there will be 3 re-try attempts. Even 2rd attempt fails the workpsaces belongs to that invoice gets BLOCKED. Customer can't use those workspcase. Customer needs to make sure the payment arrangement done for the same. Customer have the 'Pay Now' option for the failed invocies which once paid the workspaces status becomes ACTIVE and can be used again.

alt_text

Invoice contains the details like total api consumed, domain charges, discount if applicable and taxes and email will be sent to the registed user email id.

The invoice amount will be charged on the same day of invoice generation. If Invoice amount is not paid with 3 attempts, then the workspace will be marked as BLOCKED.

Once the invoice amount is paid through Pay Now option, then workspace status will be changed to ACTIVE.

Debug Issues

Using SmartView

Using SmartAssist

Cognitive QnA Issues

Classifier Issues

NLP Issues

NLU Issues

Context Issues

Small Talk Issues

Improve Accuracy

Using SmartAssist

Finetuning Settings

Manage Updates & Upgrades

Use Pre Built Domains

Manage Ontology

Migrate from other Platforms

Migrating from Watson

Migrating from Luis

Migrating from Api.ai

Pricing

Plan Pricing details

Tables FREE Free for 30 days BASIC $300.00 for 20 ,$1.00 Per API Billed Monthly PREMIUM $100.00 for 10 $1.00 Per API Billed Monthly
Small Talk Y Y Y
FAQs Y Y Y
Model Updates Monthly Monthly Fortnightly
Training Cycles 20/Month 30/Month Unlimited
Fullfilment Nodes Channel & Conversational Workflow runtime Shared Shared Dedicated
Auto Scale Hardware Capacity Scales based on user traffic N N Y