- 16 May 2024
- 3 Minutes to read
- Print
- PDF
Built-in Actions
- Updated on 16 May 2024
- 3 Minutes to read
- Print
- PDF
Built-in Skills
Digital Agent comes preloaded with some rudimentary skills.
Choice Skill
This skill is a spin-off from the realization that most chatbot conversations will eventually have a question with hardcoded choices as answers. Although a content element lets the user select buttons to pick a response, the choice skill adds a few more caveats to that content element, which we will explore here.
Figure: Choice Skill
In addition to just letting you click a button and you are on your way, the choice skill adds a few checks and transitions to the process.
First of all, where freely typed responses are not disabled, the choice skill allows you to add answers which the user might type directly. In this way, the chatbot can understand and classify other responses besides the button click, adding a good measure of flexibility.
Figure: Choice skill configuration
The choice skill also allows you to let the user have another go at answering the question asked. In instances where the user might fail to perceive that a button response is required, the chatbot prompts the user to choose from the supplied choices. It is also crucial in cases where the chatbot developer does not pre-empt the freely typed responses.
If the chatbot doesn't understand a user's answer, it will react by guiding the user on how to respond to the question before asking the question again.
Figure: Choice skill - Advanced settings
The choice skill also offers an option to transition to a different node when the user repeatedly fails to answer a question.
Figure: Node Properties
Email Skill
The email skill provides a quick way to send emails from within a Digital Agent workflow.
Configuring Email Skill
To send an email using the email skill, you need to configure your chatbot with a transport connection string. Set the configuration string in the directory ...data/global/config/basic-skills.json. For more information on the mail transporters available and how to configure them.
Here is an example of a configuration using a mail server:
Creating your Skill
From the Flow Editor view, click on Insert Skill > Send Email. The subsequent interface allows you to insert the information you would fill in using any standard email service.
From, To, CC & BCC - These fields are filled with email addresses. The From field will be the sender's email address that the recipient will see when receiving an email from your chatbot. You can configure it to any valid email address.
Subject - This field contains the subject of the email. You will need to create a content element that will load as the subject line. Please note that it will render as plain text even if you use markdown in the subject line.
Email Content - This field will load from a content element. Unlike the subject field, you can use markdown, which Digital Agent will render correctly to the receiver. You can also include HTML to enhance the formatting of your email body further.
It is worthy to note that Digital Agent supports templating in all fields of your email skill, allowing access to variables stored in Memory. All bot, user, session, temp, and event are accessible via templating. To access these variables, reference the memory location.
Action Example
We will use axios as an HTTP client.
Start by creating a new JavaScript file in /data/global/actions/callApi.js.
Using the Action
Add an onEnter action instruction in your node and select the callApi action from the list:
Figure: Use Action
Add a Text Content Element
Create another onEnter instruction to make your bot say something. Once the first instruction executes, the response is stored in the session variable.
Here we use templating to get the description of the first repository from the list:
Figure: Add a Text Content
Once everything is completed, this is what your node should look like:
Figure: Node
Other Skills
Two other skills, namely, the Call API and the Slot Skill are available in Digital Agent. You can look up these skills and use them in your chatbot.