Define Params
Introduction
The input data received from a user during a conversation with a bot is described as params of an action. If we consider the execution of an action analogous to filling a form, then the fields in the form can be considered as params for the action.
For example, the params for an action to create an event would typically be :
- Title of the event
- Start time of the event
- End time of the event
Users can provide value to each of these params in a conversational way in their natural language. Based on the configured params for an action, ConvoKraft will automatically comprehend the intent of the message and extract the apt value of the params.
ConvoKraft uses its NLP ability to draw a match between the configurations being made to the action and the user’s input at runtime. It will convert the user’s input into a computational value as per the declared data type of the specific param. We will be discussing more about the supported data types of a param later in this page. These params will in turn be used in the business logic to perform the required operations of the bot.
You can learn more about the implementation and usage of params while creating an action.
- Defining params will be applicable only if you have chosen to configure your action to execute a business logic.
- An action can have a maximum of 20 params.
Attributes of a param
In this section, we will discuss about the various attributes of a param in detail:
-
Param Name
A valid name for the param must comply with the following points :
- Begin with lower case
- Only numbers and letters are allowed
- Contains a maximum of 50 characters
- Must be unique for every action
- The following names cannot be used as a param, as they are reserved words in ConvoKraft such as userInput, previousParam, additionalParams, sessionData, broadcast, previousUserMsgs, cache, org, and user
- Param Type
You can choose the required data type for your param from the list of supported types in ConvoKraft :
Data Type | Description |
---|---|
String | A single input of type String |
Integer Number | A single input of type Integer |
Integer Number Range | Two inputs representing the start and end range of integers |
Decimal Number | The number of digits to be rounded off for a decimal number. The maximum precision allowed is five. |
Decimal Number Range | Two inputs representing the start and end range of decimals. |
Date | A single input of type Date |
Date Range | Two inputs representing the start and end range of date |
Date/Time | A single input of type Date/Time |
Date/Time Range | Two inputs representing the start and end range of Date/Time |
Boolean | a YES or NO input |
A single input of type Email | |
Amount | Amount input with currency code / currency symbol |
File | A file to be uploaded as user input. For this param, you can specify what file types the user can upload. The supported file types are mentioned below. |
Single selection list | A list of available options from which the user can select one. The details are given below. |
Multiple selection list | A list of available options from which the user can select more than one. The details are given below. |
- An action cannot have any date or time params if it already has a date range or time range param.
- An action cannot have any integer or decimal params if it already has an integer range or decimal range param.
For the file param, you can define the supported file types as follows :
Formats | Supported File Types |
---|---|
IMAGE | image/png, image/jpeg,image/bmp, image/tiff, image/vnd.microsoft.icon |
DOCUMENTS | text/plain, text/csv, application/rtf, application/msword, application/vnd.openxmlformats-officedocument.wordprocessingml.document, application/vnd.oasis.opendocument.text |
application/pdf | |
PRESENTATION | application/mspowerpoint, application/vnd.ms-powerpoint, application/vnd.ms-powerpoint, application/vnd openxmlformatsofficedocument.presentationml .presentation, application/vnd.oasis.opendocument.presentation |
SPREADSHEET | application/vnd.ms-excel, application/vnd.msexcel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.oasis.opendocument.spreadsheet |
AUDIO | audio/mpeg , audio/wav, audio/midi, audio/x-midi, audio/aac |
VIDEO | video/mpeg, video/x-msvideo ,video/x-flv, video/mp4, video/quicktime |
COMPRESSION | application/zip, application/x-tar, application/gzip |
Single and Multiple Selection List
For single and multiple selection list params, you need to enter the following additional information:
-
Options : These are the list of available options from which the user can select either one or multiple choices.
You can configure the options statically without using any code. It is recommended to give every option a distinct value that can be understood by the user. Every option has an ID, which is used to uniquely identify an option programmatically. You can either enter the ID for every option manually or use the auto-generated ID as you type in the options. A valid name and ID for the selection list options must comply with the following points:
- ID only supports alphanumeric characters, hyphen and underscore
- The option name can have a maximum of 150 characters
- A selection list param can have up to 50 options
-
Buttons : Buttons represent the actions to be executed on the selected selection list options. The default action is to submit these selected selection list options, if no custom buttons are configured.
The properties of a button include the following :
-
Label - The display text of the button.
-
ID - An identifier for the business logic to uniquely identify which button is chosen during conversation.
-
Theme - The colour scheme that reflects the appearance of the button in the conversation. The following three themes are supported.
- Positive
- Negative
- Neutral
A valid name and ID for the buttons must comply with the following points :
-
A button name and ID can include all alphanumeric and special symbols.
-
They can contain a maximum of 150 characters.
-
A selection list param can have up to three buttons.
-
Allow values other than these options : This option allows the user to submit their own values rather than selecting from the list of options you defined. If this option is enabled, then the IDs of such values will be set as null.
-
Mode of Input : This specifies the way in which a user can provide a value to the param. It can either be Textual or Visual. If Textual is chosen, the user will be able to type the preferred value that they want to assign for the param. In the case of Visual, the user has to select their input from the available visual options. The options will be displayed as a radio button (in case of single selection), check box (in case of multiple selection) or a date/time picker (in case of date/time range).
-
Prompt Message : The question that the bot would ask the user to get the input for the param as a part of a bot conversation with the user. For example, to get the value for the start time of an event in the create event action, the prompt message shall be set as “What time does the event start at?” or “When is the event?”. This field cannot be left empty and it must comply with the following points
- It can include all alphanumeric and special symbols except #, /, , &, *, +, = and ().
- It can contain a maximum of 255 characters.
For params involving a range, the Prompt message field is split into:
- Start of the Range : Prompt message to get the start value of the range.
- End of the Range : Prompt message to get the end value of the range.
-
Prompt message on validation failure : The custom message to be displayed to the user when the user input is found invalid for the prompted param. This field is optional.
-
Allow to skip: Enables the user to bypass answering a param while conversing with a bot.
Defining a param
In this section, we will discuss a few example scenarios to explain the usage of params in a ConvoKraft action:
- Lets consider a scenario where the user needs to initiate a return request for an online order. The user would ask something like this :
“I would like to return my order”
“Return my order”
“Return this product and request refund”
You can create a param order id to fetch the details from the user upon initiating a return request and associate the param with any phrase in your sample invocations. So that when the user enquires about the return, the bot would immediately prompt to ask the order number.
- Lets discuss another scenario to schedule a meeting in the calendar.
The user would type in something like this:
“Schedule a meeting in my calendar at 5pm tomorrow”
“Add a meeting for tomorrow”
In this case, you can create params such as eventname(String), eventtype(Single selection list), eventdays(Multi-selection list), eventtime(Date/Time Range).
To learn about configuring a param while creating an action for your ConvoKraft bot, please refer to creating an action.
Last Updated 2023-07-04 12:32:14 +0530 +0530
Yes
No
Send your feedback to us