Deluge Object Reference

The Deluge Object Reference documentation aims to give a detailed idea about the various elements of the Deluge functions in ConvoKraft. The core objects supported by ConvoKraft include the data access objects, input objects, and response objects. We will be discussing each of them in detail in this section.

Data Access objects

sessionData

The details about the current chat session of the client. This data will be available for all functions under the sessionData argument.

Deluge Data type Availability
Map In all functions

This argument comprises the following keys:

Key name Deluge data type Description Sample value
medium Text The mode of communication through which the user interacts with the bot. The possible values are call or chat. chat
client_host Text The nature of the client application that hosts the bot. The possible values are mobile or web. web
client_identifier Text The unique identifier of the client.
The URL of the web application, if client_identifier is web.
The package name bundle identifier of the mobile application, if client_identifier is mobile.
https://zylker.com
client_data Map The data passed from the client to ConvoKraft at the start of the session. { "user_email": "todd@hmail.com" }

cache

The cache object acts as a temporary storage variable. Any data stored in this object in the form of key-value pair will be accessible across all the functions of the currently executing action until that action execution completes.

Deluge Data type Availability
Map In all functions

broadcast

If you want your bot to remember any information related to the current executing action, the information can be stored in the broadcast object. This value will be retained even after the execution of the current action, and will be available for all subsequent actions until the current chat session is over. Subsequent actions can use this value, as required by business logic.

Deluge Data type Availability
Map In all functions

messageData

The messageData object contains the custom message sent by the client for each transcript (a message in the bot conversation) request in the data key.

Deluge Data type Availability
Map In all functions

Input Objects

param

The input values provided by the user for each static param would be captured under the objects with the same param name across the Deluge functions.

Deluge Data type Availability
corresponding param's data type In Context handler function and Action execution function

previousParam

The previousParam object contains the param that was last prompted to the user. The latest reply of the user will be set as a value to this param.

Deluge Data type Availability
corresponding param's data type Only in Context Handler function

Response Objects

card

The card can be used to give a visually formatted message as a reply to the user. A card is a collection of visual elements, such as tables and images. The value of this key is a list of map objects. Each map object represents an UI element in the card. A single card may contain more than one element of the same type. Every element in the card will be displayed one below the other in the reply message.

The inline formatting options such as Bold, Italic, Underline, Strikethrough, Link, and Highlight are applicable to the card elements as well. So, any of these above mentioned formatting options can be used in the text values in any of the below cards.

The following UI elements are supported in ConvoKraft’s reply message card :

Element Format
Note
    
copy
{ "type" : "note", "content" : "<Text content that needs to be displayed as a note.>" }
View more
Title
    
copy
{ "type" : "title", "content" : "<Text content that needs to be displayed as the title>" }
View more
List - Bullet & Numbered
    
copy
{ "type" : "list", "format" : "bullet" or "numbered" "elements" : [ { "label" : "<element_label>" "preview" : { "header" : { "title" : "<title_content>" "description" : "<description_content>", "subheading" : "<subheading_content>", "image" : { "url" :"<image_url>" } }, "fields" :[ { "label" : "<field labels>" "value" : "<field values>" } //add other fields as necessary ] } } //add other elements as necessary ] }
View more
Note : In the list card, a maximum of seven fields can be configured for a preview object.
Table
    
copy
{ "type": "table", "heading" : "<Table Heading>", "columns": [ "<column1 header>". "<column2 header>" "<column3 header>" ], "rows": [ [ "<value al>" "<value a2>" "<value a3>" ], [ "<value b1>" "<value b2>" "<value b3>" ] ] }
View more
Image
    
copy
{ "type" : "image", "content" : "<image url>" }
View more
File
    
copy
{ "type" : "file", "name" : "<file_name>", "format" : "pdf", //file extension "content": "<file url>" }
View more
Contact card
    
copy
{ "type" : "vcard", "info" : { "image" : "", "fields" : [ { "First Name" : "Smith" }. { "Last Name" : "Gibbs" }, { "Company": "ABC Corp" }, { "Website" : "https://" } ] } }
View more
Link
    
copy
{ "type" : "label", "content" : "<URL link>" }
View more
Button
    
copy
{ "type" : "button", "label" : "<button label>". "theme" : "<button theme>" "id" : "<button id>", "onclick" : { "execute" : "function (or)clienthook", "function":"<button click function name>", "data" : {} } }
View more
  1. For theme key, the value can be either positive, negative, or neutral.
  2. For execute key, the value can be any one of the following:
  • function - to execute the defined Button Click function.

  • clienthook - to execute the hook implemented by the client application.

    If clienthook is set as the value to the execute key, then the function key is not required.

  1. For the data key, set any value that needs to be passed to the button click function.
Note : A maximum of three buttons can be configured for an action using the button card.

Last Updated 2023-07-20 13:39:11 +0530 +0530