Teneo Developers

Convert a Composer bot

Extend Teneo web Chat functionality

The Composer bot presents the weather information with a card and an icon, which is achieved using an attachment. In Teneo, we can achieve the same thing using the card functionality of Teneo Web Chat. Let's add that functionality now.

  1. Open the Get weather flow in edit mode.
  2. Navigate to the output node where the bot summarizes the weather information.
  3. Locate the Output Parameters section in the configuration panel and click on 'Add'.
  4. Give the output parameter the name teneowebclient.
  5. Paste in the following value:

json

1{
2    "type": "card",
3    "image": {
4        "image_url": "http://openweathermap.org/img/wn/${icon}@2x.png",
5        "alt": "Weather icon"
6    },
7    "title": "Weather in ${city} in ${country}",
8    "text": "It is ${weather} in ${postalCode} and the temperature is ${fahrenheit}°F or ${celsius}°C. Have a nice day."
9}
10
  1. Hit 'Save'.
  2. Republish your bot and try talking to it in Teneo Web Chat again to see the updated bot response.

Note that the bot now gives two responses: the first that we added, which is shown as plain text, and the second, which is in the form of a card. The first could be removed if only the card is desired; however, note that the card will not show up as a response inside Tryout, unlike the first response.

Next page
Download
Was this page helpful?