How to show images in Rasa Chat from custom action


Can anyone help me showing images in Rasa X chat from custom actions? I tried to use the following but nothing worked:

dispatcher.utter_message(text="") dispatcher.utter_attachment({image=""}) dispatcher.utter_attachment("")

hey @kshitiz12345, try sending the image using below line:


Hi @JiteshGaikwad

I tried your approach but still no luck. In Rasa x, I am not able to see the image. This is how I am using the code:

 for article in resp["articles"]:

Any other clue?

which version of rasa are you using?




hey @kshitiz12345, I checked the above code and it didn’t worked for me too in Rasa X but it’s able to show me the image reponse when I test it in the postman and it’s rendering the image If I send it from domain.yml file:

rasa version that I am using:

rasa                              1.7.3              
rasa-sdk                          1.7.0              
rasa-x                            0.25.2   

@erohmensing, is there any problem for rendering images in Rasa X if we send the image from custom actions since it works if we send the images registered in domain.yml? contents:

class ActionHelloWorld(Action):

    def name(self) -> Text:
        return "action_hello_world"

    def run(self, dispatcher: CollectingDispatcher,
            tracker: Tracker,
            domain: Dict[Text, Any]) -> List[Dict[Text, Any]]:


        dispatcher.utter_message(text="Hello World!")

        return []

@Tanja Will it be possible for you to help me here?

@JiteshGaikwad I’m not sure. It might be that the response format is coming strangely from the rasachat connector. Can you post the ouput you’re seeing in Rasa X?

Hey @erohmensing, I have attached the output here.

Did you solve this issue ?

Also , What if I have an image on in a seperate folder, inside data. How will I retutn that image? I’m using ngrok, to host via localhost and using telegram.

My try was :

> dispatcher.utter_message(image="/p38.png")

raise BadRequest(message)

telegram.error.BadRequest: Url host is empty 2020-04-18 14:05:32 ERROR rasa.core.channels.telegram - Exception when trying to handle message.Url host is empty

I’m getting the below error.

Any help would be much appretiated.

Anyone solved this.
I try this:
dispatcher.utter_message(image = "") but nothing display on Rasa X. This is my version:
rasa 1.10.10
rasa-sdk 1.10.2
rasa-x 0.31.4

Please anyone can solve this issue…? I appreciated your help, My version: rasa==1.10.2 rasa-sdk==1.10.1 rasa-x==0.32.2