How to display image inside project folder in custom action - Getting Started with Rasa / Tutorials, Resources & Videos - Rasa Community Forum

How to display image inside project folder in custom action

post by _sanjay_r on Apr 18, 2020

Hi all,

I have an image in my project directory. My bot is hosted on telegram via ngrok.

I have a custom action, to display the image as well. I tried using

dispatcher.utter_message(image="/p1.png")

But it doesn’t display the image.

What path do I give to display the image?


post by bparikh99 on Apr 18, 2020

Link=https://i.imgur.com/nGF1K8f.jpg

you can use utter_template(template_name ,tracker,link=Link)

template_name will render that image


post by _sanjay_r on Apr 18, 2020

hey @bparikh99,

But that is a link of an image, that’s on the internet right ? For that it works.

The image i want to show is on my local machine ( inside project directory ).

Then, it’s not working.


post by k1m on Apr 18, 2020

Hi @_sanjay_r. Here’s what Alan said:


post by _sanjay_r on Apr 19, 2020

Thanks @k1m,

I used imgur.


post by Jivitesh on Jan 6, 2021

what is passed to template_name in utter_template? im a little confused about that