Components
EARLY ACCESSA component is a reusable block that does a specific task. It gets specific inputs, processes the input, and gives a structured output.
A component is built in Chatbots and uses the same building blocks as a Chatbots chatbot. So, it is a smaller version of a chatbot. It can be integrated into multiple solutions such as chatbots.
Example: Create separate components to do end user authentication, collect feedback, and answer FAQ, and use them across multiple Infobip solutions.
A component can only be used within a solution, such as a chatbot.
Advantages of components
Reusability: Some sections of the chatbot might be repeated, either in the same chatbot or in multiple chatbots. Instead of recreating the same section in multiple places, create a component and use it wherever required.
There is no limit to the number of times you can use a component either within the same solution or in multiple solutions.
Easier updates: If you need to make changes, update the component, not the solution in which it is used. The change is automatically applied wherever the component is used. This saves time and increases consistency.
Simpler maintenance and troubleshooting: Break down large tasks into multiple components. Each component focuses on a specific task, thus making it easy to maintain and troubleshoot.
Simpler solution design: Components help simplify the design of the solution. Example: Components can reduce the number of dialogs required in a chatbot.
Platform-independent: Components can be used across multiple Infobip solutions, such as Chatbots chatbots.
Supports collaboration: Because components are modular, different people can work on separate components at the same time. These components can then be added to the solution.
Use components with Infobip solutions
| Product | How to use | Example |
|---|---|---|
| Chatbots |
| Create components to do various tasks such as validating end user information or providing the location of the nearest store. |
How components work
Process overview
- The component is created in Chatbots.
- An Infobip solution such as a Chatbots chatbot calls the component.
- The component receives the input values from the solution.
- The component processes the input and generates an output.
- The component returns the output values to the solution.
- The solution then either uses these values for further processing or shares with the end user.
Types of components
Components can be of the following types:
- Channel-independent
- Channel specific
Channel-independent
Channel-independent components are not dependent on a specific communication channel. They can be used in any supported solution, regardless of the channel.
These components do not contain Send elements. So, they cannot send or receive messages. They can still perform other types of processing.
Channel specific
Channel-specific components are designed for a specific communication channel. They can be used only in a supported solution that has the same channel as the component.
These components contain Send elements. So, they can send or receive messages.
Differences between chatbots and components
A component is a smaller version of a chatbot. The following are some differences between chatbots and components.
| Feature | Chatbot | Component |
|---|---|---|
| Ability to manage multiple tasks | Yes | Does a specific task |
| Supported elements | All chatbot elements | Does not support: |
| User-facing | Yes | No. Gets inputs from the solution and returns outputs to the solution. |
| Channel specific | Yes | Can be either channel specific or channel-independent |
| Sender | Has a sender | No sender |
| Supports Intents, NER attributes, Custom data types | Yes | No |
Components tab
In the Chatbots > Components tab, you can view and manage all components.
You can do the following.
-
View a list of components. Each component shows the following information.
- Name: Name of the component.
- Status: Shows whether the component is in Published or Draft status.
- Last updated: The date the component was last updated.
- Created by: Name of the component creator and the date it was created.
-
Sort components. Select a column header to sort.
-
Import previously exported components, including their settings and setup.
-
Search for components. Use the Search box.
Create a component in Chatbots
Components are built in Chatbots. The process of creating a component is similar to that of building a Chatbots chatbot.
Process overview
- Create a draft component by using one of the following ways:
- Create manually.
- Create from dialogs in an existing chatbot.
- Create input and output attributes for the component. The component gets the input from the chatbot and passes the output to it through these attributes.
- Design the component.
- Configure the settings.
- Test the component.
- Publish the component.
- Use the component in your chatbot.
Create a draft component manually
To create a draft component manually, do the following:
-
On the Infobip web interface (opens in a new tab), go to Automation Studio > Chatbots > Components tab.
-
Select Create component.
-
In the New component screen, complete the following fields.
- Component name: Enter a unique name.
- Channel
- To create a channel-specific component, select the required channel.
- To create a channel-independent component, select Any channel.
-
Select Create component.
A new component is created and opens at the Dialogs tab. The Default dialog contains a Start dialog block.
Create a draft component from existing chatbot dialogs
Create a draft component by selecting specific dialogs and dialog groups in an existing chatbot.
What is included in the component
The component contains the following chatbot building blocks from the source chatbot.
- Dialogs: The dialogs and dialog groups that you select
NOTE
The Default dialog is not copied. The component has a new Default dialog that contains a Start block.
- Chatbot building blocks: The following are included if they are used in the selected dialogs. Any chatbot building blocks that are not used in these dialogs are not added to the template.
- Keywords and synonyms
- Attributes
- Settings: Any chatbot settings that are also applicable to components. Chatbot settings that are not available in components are not copied.
Create the draft component
-
On the Infobip web interface (opens in a new tab), go to Automation Studio > Chatbots.
-
Open the chatbot from which you want to create the component.
-
Select one or more dialogs and dialog groups that you want to add to the component. To select all dialogs and dialog groups, use Select all.
-
Select Create component.
-
In the Create component screen, complete the following fields.
-
Component name: Enter a unique name.
-
Channel
-
If one or more of the selected dialogs contain channel-specific elements, you cannot change the channel. The component uses the same channel as the chatbot.
-
If none of the selected dialogs contain channel-specific elements, you can select a channel that is different from the chatbot.
- To create a channel-specific component, select the required channel.
NOTE
Currently, you can change only to WhatsApp, Live Chat, Messenger, or Telegram.
- To create a channel-independent component, select Any channel.
- To create a channel-specific component, select the required channel.
-
-
-
Select Create component.
A new draft component is created and opens at the Dialogs tab. The Default dialog contains a Start dialog block.
Create input and output attributes for the component
Components get inputs from the chatbot and return outputs to it.
In the Attributes tab, create the input and output attributes that are required for the component. Also, create any other attributes that are used by the component.
Do the following:
-
Select Add attribute.
-
In the Create attribute window, configure the following fields:
-
Name: Each attribute must have a unique name.
-
Type: Data type of the attribute.
-
Default value (Optional): Specify a default value for the attribute.
-
Scope: Select one of the following:
-
Dialog: The attribute value is specific to a dialog. If this attribute is used in other dialogs, the attribute value in those dialogs is either the default value or blank.
Example: The default value of the opt_in attribute is False. In a specific dialog, the opt_in attribute value changes to True. But in all other dialogs, the attribute still has the default value, False.
-
Component: The attribute value is the same across all dialogs in the component.
Example: The default value of the opt_in attribute is False. In a specific dialog, the opt_in attribute value changes to True. In all other dialogs, the attribute now has the value, True.
-
-
Available to agents: If you select this field, the attribute value is visible to an agent when the chat is transferred from the chatbot to an agent in Inbox. In Conversations, the attribute value is displayed in the context card of the conversation and the conversation history.
If you also select Sensitive data, the attribute value is displayed as a hashed value in Chatbots and Conversations.
To hide the attribute value from agents, deselect this field.
Example: For the accountId attribute, the Available to agents field is enabled. So, in Inbox, this attribute is displayed in the context card, as shown in the following image:
-
Sensitive data: If you select this field, the attribute value, including default value, is encrypted when it is stored in the database. It is displayed as hashed data in Chatbots and Conversations.
Example: The message is displayed as follows.
When this field is disabled: Your account balance is 2123.32.
When this field is enabled: Your account balance is ####.##.
Use this field if the attribute contains sensitive data. This setting is especially useful when chats are transferred to live agents.
This setting is applicable only for sensitive attributes that are present in outbound messages.
-
-
Select Save.
The attribute is listed in the Attributes tab.
Design the component
Similar to a chatbot, components contain one or more dialogs. These dialogs work together to perform tasks.
The Default dialog is added automatically to the component. In addition to other dialog-related tasks, the Default dialog is used to get input values from the chatbot.
To design a dialog, do the following:
-
(Default dialog only) In the Default dialog > Start dialog block, select the required input attributes that you created.
-
Add elements to configure the dialog as required.
-
At the end of the dialog, either add an Exit element or a To dialog element. Each dialog must have one of these elements.
The Exit element ends the component processing and passes the values of output attributes to the chatbot. So, add this element to the relevant dialogs.
-
In the Exit element, select the required output attributes.
NOTEThe output attributes that you select are used across all Exit elements in the component. If you update the output attributes in one Exit element, the changes are applied to all Exit elements.
Configure the component settings
Configure the component settings.
Test the component
Test the component in the Test tab.
-
Go to the Test tab.
-
Enter the values of the input attributes.
-
Select Start simulation.
-
Select a building block such as Dialog start to see the processing in the right-hand panel. Select Exit to see the values of the output attributes.
Restart the simulation
You can restart the simulation as follows:
- To use the same input values, select Restart simulation.
- To use different input values, select Change input value.
Publish the component
Select Publish.
If there is an existing Published component with the same Component ID, that component is unpublished. The new component replaces the existing component in all solutions in which it is used.
Component settings
-
Component name: Use a unique name that describes the component.
-
Component description (Optional): Add a description for the component. Select the Text icon to use formatting, such as font size or headings.
-
Component ID: A component ID is created by default. You can update the ID either manually or automatically by selecting Generate.
-
Voice messages: Use voice functionality in your component.
This setting is applicable for channel-specific components that contain messaging elements.
-
Component timeout: Configure the duration that the component waits for either the result of its internal processing or a response from an API call. This field has a predefined value of 5 minutes.
-
Tracking and URL shortening: If your messages contain links (URLs), you can shorten URLs and track URL clicks.