Skip to content

Latest commit

 

History

13 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cognitive Assistant JavaScript SDK

This SDK requires a Account with Humley account. Please contact Humley [email protected]

Installation:

Bower:

bower install Humley-Cognitive-Assistant-JavaScript-SDK --save

Latest File:

cognitive-assistant/h-assistant.js

Example:

allowfeedback is defaulted to true. This will allow you to get feedback after each question is reecived..

var humleyBot = new humleyConversationBot(
	{
		username:'username',
		password: 'password',
		productId: 12
	},
	allowfeedback
);

Methods

async humleyBot.init(interface:Init) : boolean

Init: Use to start session. If return false then an error has occurred

async humleyBot.talk(string) : interface:ConversationResult

Talk is the core method to receive the reply from your Cognitive Assistant

async humleyBot.sendCheckPoint(checkpointId:number, variableName:string, value:string) :null

Send checkpoint to track activivty.

Check Point Id

Open in Browser 6001. This checkpoint should be fired when a user presses an action which has an action type of browser.

Client Error - 8064

async humleyBot.sendFeedback(typeId) :null

If "allowedfeedback" is set to true, you can send feedback on the last answer received.

##Interfaces##

interface:Init:

 interface init {
 params: Object; // information about the user
 uuid: number; // - optional humley uuid for user set by imei 
 cv: string; // - optional
 mx: string; // - optional
 imei: string; // unquic ID to user
 udid: string; // - optional
 noid: string; // - optional
 imsi: string; // - optional
 simid: string; // - optional
}

interface:ConversationResult:

interface ConversationResult {
    question: string;
    error: boolean;
    replies: ConversationResultReplies[];
    errorInfo: any;
}

interface:ConversationResultReplies

interface ConversationResultReplies {
    replyId: number;
    actionType: string;
    actionURL: string;
    category: string;
    buttonId: number;
    confidence: number;
    reply: string;
    hasVideo: boolean;
    video: ConversationResultRepliesVideo;
}

interface:ConversationResultRepliesVideo

interface ConversationResultRepliesVideo {
    header: string;
    url: string;
}

Feedback type ID:

3 = yes
2 = sort of
0 = No

About

Javascript SDK for Humley's Cognitive Assistant

Resources

Stars

0 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages