Create a new chatbot from a template
EARLY ACCESSCreate a new chatbot that is a duplicate of a template. You can then customize the new chatbot to meet your requirements.
The new chatbot uses the same channel as the template.
To create a new chatbot from a template, you must have the associated channel enabled in your account. If you do not have the channel enabled, you can only preview the template and simulate the conversation. You cannot create a chatbot from the template.
What is included in the chatbot
The new chatbot contains the following from the template.
- Dialogs and dialog groups, which include the chatbot elements.
- Intents
- Keywords and synonyms
- Attributes
- NER attributes and custom data types
- Chatbot settings
Create the chatbot
- On the Infobip web interface (opens in a new tab), go to Automation Studio > Chatbots > Templates tab.
- Go to either the Predefined or Custom tab as required.
- Do one of the following.
- Hover over the template that you need and select Add.
- Hover over the template that you need and select Preview > Add template.
- Select the required channel and language.
- Select Add template.
A new chatbot, which is a duplicate of the template, is created.
Next steps
- In the new chatbot, make the changes that are required for your use case. See the Guidelines and best practices and Customize the Chatbot sections.
- In the Settings tab, update the sender if required.
- In the Test tab, test the chatbot.
- To use the chatbot in a live environment, select Activate.
Import a template into an existing chatbot
Use this section when you want to import a template into an existing chatbot.
You can import only custom templates into a chatbot.
You can import only templates that use the same channel as the chatbot. Example: In a WhatsApp chatbot, you can import only WhatsApp templates.
What is imported
The following are imported from the template.
- Dialogs and dialog groups, which include the chatbot elements. The default dialog from the template is imported as a regular dialog into the chatbot.
- Intents
- Attributes
- NER attributes and custom data types
- Keywords and synonyms
- Chatbot settings
The imported chatbot building blocks have the template name as the suffix. This suffix helps you identify which building blocks are from your chatbot and which ones are from the template.
Example: When you import the Products template into the Chatbot triage chatbot, the imported dialogs have the _Products suffix.
Import the template
-
In your chatbot, select the Add from library icon.
-
Hover over the template that you want to add and select Add.
All dialogs from the template are added to your chatbot as a new dialog group.
-
Continue to configure the chatbot.
Next steps
- For the imported chatbot building blocks, make the changes that are required for your use case. See the Guidelines and best practices and Customize the Chatbot sections.
- Rename the imported dialogs if required.
- If the imported default intent does not have any training phrases, do one of the following.
- Add training phrases to the intent.
- Delete the intent.
- In the Settings tab, update the sender if required.
- In the Test tab, test the chatbot.
- To use the chatbot in a live environment, select Activate.
Customize the chatbot
Templates contain sample content, configuration, and integration. If you want to create a chatbot from a template and use it in a live environment, you must customize the sample content in the chatbot and use content that is required for your use case.
This section shows some common ways in which you can customize a chatbot.
The customization examples in this section are only for reference. When you create a chatbot from a template, make changes that are suitable for your use case.
You do not need to make all of the changes that are suggested in this section.
This section does not show a complete list of the changes that you can make to the chatbot. Depending on your use case, additional changes may be required.
To customize the chatbot, follow these steps.
After you create a chatbot from a template, do the following:
Rename the chatbot
When you create a chatbot from a template, the name of the new chatbot is similar to the name of the template.
Rename the chatbot such that it reflects your use case and business.
In this example, rename Duplicate of Advanced Customer Service to Customer Service - Infobip.
Modify text content
In the template, the elements contain sample text. Change the text to suit your use case, business, and communication style.
Example:
- In the Default dialog > Text element, update the welcome message to represent your business.
- In the Menu dialog > List element, update the text to match the communication style of your business.
- In other dialogs, add information that is relevant to your use case. Example: Update the Text element in the FAQs.
Update menu items
Menus in the templates contain sample menu items. Update these menus to meet your use case.
In this example, change the menu item 'Products' to 'SaaS Products'.
If you add or modify an element, you need to add or modify other associated elements, if applicable.
Test all changes in the simulator. You can also test an activated chatbot over a live channel.
Modify configuration for Call API
In this example, update the API element to connect to a third-party service.
The changes in this example are only for reference and are not for a live connection. You must customize the API element to meet the requirements of your use case and the API to which you want to connect.
Attributes that manage input and output information are important because they transfer information to and from the third-party system. So, configure all relevant attributes correctly.
APIs need specific inputs and produce specific outputs. So, most of the configuration, data preparation, and data manipulation is done in Code elements.
In the template and in this example, we use placeholders {{placeholder}} in API elements. If you do not want to use placeholders, you can directly enter your API URL, variables, and other data that you need for API configuration.
In the Booking dialog, we do the following.
Configure the Request
- In this example, create a new attribute 'base_url' in the Attributes tab, and delete the 'mock_server_url' attribute. We create this new attribute only as an example of the changes that you can make. You do not necessarily need to create new attributes and can use the ones in the template instead.
- In the first Code element, change the base URL and path. Also, because we created a new attribute, we need to update the attribute name as well.
- In the API element > Request tab, you can configure the following items.
- Method
- URL
- Content type
- Request headers
- Request body
In this example, make the following changes:
- In the URL field, change 'mock_server_url' to 'base_url' by using the placeholder {}.
- The API elements in templates use echo API that contain sample request headers. So, instead of modifying header values, remove the existing headers and add new ones. In the Headers section, remove all existing request headers. Add an Authorization header with the authentication token.
- You might need to modify existing parameters to meet the requirements of the third-party API. In this example, the third-party API uses the booking_date parameter. So, in the Body section > key-value fields, change 'date' parameter to 'booking_date'. You can change this either by using the editor or the key-value pairs.
All changes for the input data are done through the 'date' attribute. The 'date' attribute is managed in the Code element, which is before the API element.
Configure the Response
In the API element > Response tab, you can do the following.
- Save response code
- Save response header attributes
- Save response body
- Set an API timeout
In this example, no items are removed. Add the option to save the Response code to the 'response_code' attribute and add a timeout.
- In the Attributes tab, create a new attribute, response_code.
- In the Response code field, choose the attribute, response_code.
- In the Timeout field, choose 5 seconds.
Add a Dialog
If you add a new dialog, you need to create or modify associated elements.
In this example, add an FAQ dialog to show the working hours of the business.
- To create the 'Working hours' dialog, do one of the following:
- Create a new dialog: Create a new dialog and configure it from scratch.
- Duplicate an existing dialog: Because the chatbot already contains FAQ dialogs, you can reuse the structure of these dialogs. Duplicate an existing dialog and make minor changes to create a new FAQ dialog.
- To keep the dialogs organized, move the new 'Working hours' dialog to the FAQ dialog group.
- Integrate the new dialog with the rest of the chatbot.
- In the Default group > FAQs dialog, which contains the FAQ menu, we need to add an option for the new FAQ. In the List element, add a new list item, Working hours.
- In the 'Working hours' list element, define the payload, Work hours, to pass to the User response element.
- In the Keywords tab, create a new keyword, Working hours, and add synonyms to it. Ensure you add the payload you created in the earlier step.
- To direct the flow to the new dialog, in the FAQs dialog > User response element, add the new keyword.
- Add the To dialog element. Choose the new dialog, Working hours.
Delete a Dialog
Delete the dialogs that you do not need.
Example:
- If you do not want a specific functionality in your chatbot.
- If you do not have a use case for the dialog.
- If you do not want to reuse the dialog for a different use case.
If you delete a dialog, you need to delete or modify associated elements.
In this example, delete the Press/News dialog.
-
In the FAQs dialog group, delete the Press/News dialog.
When you remove a dialog, there is a warning that this action cannot be reverted.
-
When you remove a dialog, ensure its reference is removed from other places so that end users are not stuck in a dead end. Do the following.
-
In the Default dialog group > FAQs dialog > List element, delete the Press/News list item.
-
In the User response element, delete the keyword, Press and news.
NOTETest all changes in the simulator. Make changes until the chatbot works as expected. You can also test an activated chatbot over a live channel.
You can explore chatbot templates in your Infobip account (opens in a new tab).
-
Guidelines and best practices
The following guidelines are specific to customizing the template to use in a live environment.
- Rename the chatbot.
- Customize the content to suit your use case and business. Example: In the Welcome message, mention your business name. In menu items, add products and services that are relevant to your business.
- Any changes that you make must fit into the existing configuration.
- If you add or modify an element, ensure it is similar to the existing elements. Example: In a List element, if existing list items have icons, add icons to new list items as well.
- If you add or modify an element, add or modify other associated elements, if applicable. Example: If you add a list item to a List element, create a new branch for that item in the User response element, and create an associated dialog.
- If you delete an element or a field within an element, modify or delete other associated elements, if applicable. The associated elements could be in other dialogs. Example: If you delete a list item in a List element, delete the associated branch in the User response element, and delete the associated dialog.
- If you delete a dialog, either modify or delete all references to the dialog. Example: If there are menu items in other dialogs that direct the flow to the deleted dialog, either delete those menu items or redirect the flow to a different dialog.
- If you change the chatbot language, modify the content in the Dialogs tab to match the new language.
- Test all changes in the simulator. Make changes until the chatbot works as expected. After you activate a chatbot, you can also test it over a live channel.