Unltd AI logo

Getting started


Bot Input Entity

A BotInput is a versatile entity that represents an individua input field within the form associated with a Bot. It allows users to specify and structure the data that is required from the end-users interacting with the bot. This data is essential for the bot's processing and generating meaningful and personalized responses.

The BotInput can represent a wide array of UI input types to cater to different data gathering needs. It supports the following input types: 'checkbox', 'checkboxImage', 'file', 'number', 'radio', 'radioImage', 'select', 'slider', 'switch', 'text', and 'textarea'.

Each BotInput instance is associated with certain properties such as a label, default value, and whether it is required or not, offering granular control over the data collection process. Some BotInput types can also define a set of options for the user to choose from, with each option potentially having an associated image and a text description.

In sum, a BotInput entity allows the creation of a highly customizable, dynamic, and interactive form for end-user data input, enhancing the bot's ability to provide accurate and personalized results based on user inputs.

Bot Input Attributes

accept

String

An optional field of file types which will be accepted by the input.

Example:

".jpg, .png".

bot

Bot

Reference to the Bot that this input belongs to.

createdBy

ObjectId - User

ID of the user who created the bot input.

defaultValue

Mixed

Default value for the bot input. Can be a number or a string.

editedBy

ObjectId - User

ID of the user who last edited the bot input.

image

ObjectId - File

Reference to a file object representing the image for the bot input.

inputGroup

Number

"prompt" = 0, "bot" = 1, "options" = 2, "fileUpload" = 3

Grouping index for the input field. Used to position the input.

inputType

String

"checkbox", "checkboxImage", "file", "json", "number", "radio", "radioImage", scraper, "select", "slider", "switch", "text", "textarea"

Type of input. Should be one of the pre-defined input types.

label

String

Label for the bot input.

max

Number

Maximum value for the bot input (for number and slider, type inputs).

min

Number

Minimum value for the bot input (for number and slider type inputs).

multiple

Boolean

Indicates whether multiple files can be selected (for file type inputs).

name

String

The name of the bot input.

options

Array[BotInputOption]

Array of option objects for the bot input (for checkbox, checkboxImage, radio, radioImage and select type inputs).

placeholder

String

Placeholder text for the bot input.

required

Boolean

Indicates whether the bot input is required.

rows

Number

Number of rows (for text area type inputs).

step

Number

Step increment for the bot input (for number type inputs).

value

Mixed

Current value of the bot input. Can be a number or a string.

Bot Input Option Attributes

image

ObjectId - File

Reference to a file object representing the image for the bot input option.

text

String

Text for the bot input option. This is required.

value

Mixed

Value for the bot input option. Can be a number or a string. This is required.

{
  "id": "60c73adf12f3f30b8cd165a2",
  "accept": "image/*",
  "bot": "60b6fa4cd999d31a6cf7b5b0",
  "createdBy": "60a6fa4cd999d31a6cf7b6d0",
  "defaultValue": "Default text",
  "editedBy": "60a6fa4cd999d31a6cf7b6d0",
  "image": "60c73adf12f3f30b8cd165a3",
  "inputGroup": 0,
  "inputType": "text",
  "label": "Input label",
  "max": 100,
  "min": 0,
  "multiple": false,
  "name": "input_name",
  "options": [
    {
      "id": "60c73adf12f3f30b8cd165a4",
      "image": "60c73adf12f3f30b8cd165a5",
      "text": "Option text",
      "value": "Option value"
    }
  ],
  "placeholder": "Enter the value here",
  "required": true,
  "rows": 5,
  "step": 1,
  "value": "Current value"
}