Actions

Actions are things a bot can do besides sending simple text replies. There are 2 kinds:

  • custom actions are entirely configurable actions that your bot can perform.
  • builtin actions are specific actions developed by our team and that you can use as well. They usually require some slots as an input, and can write to some slots as an output.

Custom Actions

Show Choice

This action allows your bot to display a list of options. Most chat applications will display choice options using buttons, and let users click on one of them instead of typing. Each option should be a reply, which means you can use slots.

A link sent using this action will be displayed with a little preview using most chat applications. It is possible to use slots here as well. Use media type Image if your link points to an image and you want to display the image directly in the chat instead of the link.

Intercept Next Input

This action allows you to save the next user input into a slot and execute the trigger of your choice. The intent and entity recognition will be skipped. This is useful if you want to use the exact user input without having to recognize an intent or an entity.

Pick Random Value

This action picks a random number within a given range, or a random value from a list. The picked number or value will be saved into a slot.

Find and Replace with Regex

With this action, you can use a regular expression to find or replace text in a slot. In the Find mode, the number of matches is saved to a slot, while in the Replace mode, the modified text is saved to a slot.

Transform Text

You can use this action to modify the text from a slot. We currently support 2 transformations: reversing the text (abcde becomes edcba) and changing its casing (all lowercase, all uppercase, or only the first letter uppercase). The slot will be overwritten with the transformed value.

Call Webhook

This action is one of the most powerful, because it gives you the possibility to call your own APIs during a conversation with a bot. It supports GET, POST, PUT and DELETE requests, with optional headers, query parameters and JSON body. Both query parameters and body can include replies.

As an example, you can use this feature to create a bot that turns the lights on and off. To do that, you create a custom webhook action that calls the API controlling your lights, and then you call this action when the appropriate intent is recognized.

Services like IFTTT or Twilio expose APIs that will trigger other events such as sending an SMS, calling a number, etc. They work great with this kind of action.

If the response is in JSON format, you can also extract a part of it and extract it into a slot, using the JSONPath format.

Setup Recurring Trigger

This action can be used to create, modify or delete a recurring trigger for the current user. You can choose which trigger to call, how often and when exactly.

This can be used to create a bot that reminds the user to do something at a regular interval. For example, it could be used to support queries such as “Remind me to go to bed every day at 11pm”

Builtin Actions

Some builtin actions require slots as an input or output. In that case, the bot will read the provided input slots, execute the action using those values, then write the result into the provided output slots.

Click on an action to select the required slots or create the slots inline. The Fill the blanks button will automatically create slots for all the inputs and outputs needed.

Get the News

This action will find an interesting article to read about a specific subject. The articles are provided by the news service Neil.

It requires the following input slots:

  • query: the news topic of interest. If missing, an international news article will be returned.

It requires the following output slots:

  • link: the link to the article will be written into that slot
  • title: the title of the article will be written into that slot

Get the Weather Forecast

This action will gather information about the weather.

It requires the following input slots:

  • Country: the country we want the weather from
  • DateTime: the date and time (present or future) we want the weather at
  • GeoPOI: the Point Of Interest (POI) we want the weather from
  • Locality: the city we want the weather from
  • Region: the region or state we want the weather from

It requires the following output slots:

  • Condition: the weather condition will be written into that slot. It will be one of the following: Unknown, Drizzle, Rain, Snow, Fog, Sun, Haze, Squalls, Clouds or Thunderstorm.
  • Error: any potential error while gathering the weather data be written into that slot
  • Place: the actual place that was recognized by the input slots will be written into that slot
  • Temp: the current temperature will be written into that slot if the request time was now
  • TempMax: the maximum temperature will be written into that slot if the request time was in the future
  • TempMin: the minimum temperature will be written into that slot if the request time was in the future

Listen

This action will do nothing. Use it to indicate the bot should handle some input and do nothing about it.