Adding a new Action
To add a new action to a bot, follow the steps as given below.
- In the bot's detail page, under the ACTIONS tab, click the + ADD ACTION option.
- The Create New Action page appears. Give a meaningful name for the action.
- Based on the intention of the action, choose if your action should 'Answer a question' or 'Perform an Operation'.
- If the intention of your action is to answer a question, choose whether the action should 'Give a Direct Answer' or 'Construct Answer by Fetching Data'.
- Define Sample Sentences and Parameters as required.
- Click DONE and you will be redirected to the Configuring Functions page.
- If required for your action, define Context handler function.
- After that, in Configuring Functions page, click on EDIT EXECUTION FUNCTION and define the Execution Function.
- You can test your code using the sample chat window in the right panel of the Execution Logic page.
- After defining the function and testing the action, click DONE.
The intended action would now be created and displayed under ACTIONS section. The created actions can be segregated using ACTIONS section's filter. It segregates actions as,
- Active — Actions which are created and available to use when published.
Inactive — Actions which were created and later deactivated. These actions are unavailable for chat.
Note:
The actions under the Active section will be available to chat from the bot only after the bot is published.