Unable to display images, html document in rasa x

I am running rasa version 2.2.5 and rasa x version 0.35.0. In my bot, I am trying to display images using dispatcher.utter_message('http://localhost:7000/images/my_img.png'). I have an image server serving images on port 7000 of my machine. The problem is that the actual image does not get rendered in the conversation. I only get the above link and on clicking the link, the image shows in a separate browser tab. How do I make the image appear in the conversation itself?

Similarly for an html file, how do I convert it into a clickable link within rasa x. Currently I serve it as dispatcher.utter_message('file:///path/to/my/file.html'). However this doesn’t appear as a link that the user can click on to open in the browser. How do I achieve this?

Hi @dhirajkhanna ,

The way to do this is partially described here: Dispatcher

However it’s not completely obvious even there, because in order for the image to show up in the Rasa X client, you do seem to need to include some text as well.

When I tried it with just the image returned it does not show up at all, but with a non-empty text string it will show up (even just a single space is sufficient).

  1. dispatcher.utter_message(text = ‘Your image’, image = ‘http://cdn.glitch.com/446ca0ec-cc52-4774-889a-6dc040eac6ef%2Fpuppy.jpg?v=1600261043278’) - this works
  2. dispatcher.utter_message(image = ‘http://cdn.glitch.com/446ca0ec-cc52-4774-889a-6dc040eac6ef%2Fpuppy.jpg?v=1600261043278’) - this does not work

I’m unsure if this is an intended behaviour of Rasa X or whether it’s actually not sending the image in the output unless you also have text but this should at least let you work around it within Rasa X. How it operates with your real client channel will depend on whether it’s the former or the latter problem behind it.

Hope that helps!