(Solved) [CORE/SDK] Sending Pictures from Custom Action (utter_response, utter_attachment not working)

Hello Community!

Using Rasa-Web-Chat-Widget I’m working on a Bot, that has to select a video from a database, based on the criteria given by the user. This already works fine, but instead of just sending the video link back to the user, I’d like to send the video thumbnail too.

What I already tried:

  • defining a utter_video with an image, where the “image:” part contains a Slot, which will be set by a custom action

utter_video: - text: "{VideoName}" image: "{VideoThumb}"

This doesn’t seem to work, even if I define the VideoThumb Slot as “text” and provide an initial value - the Slotname won’t get replaced with its value

  • sending a response as JSON via utter_response

image_only_message = {"image": "https://i.imgur.com/nGF1K8f.jpg"} dispatcher.utter_response(image_only_message)

This doesn’t seem to work because of the rasa_core and rasa_core_sdk dispatcher differences. When researching this problem, I found other people with the same problem, pointing out, that utter_attachement should provide a working alternative

  • sending a response via utter_attachement

image_only_message = {"image": "https://i.imgur.com/nGF1K8f.jpg"} dispatcher.utter_attachment(image_only_message)

The message received by the user now doesnt contain the image, just following text

Attachment: {'image': 'https://i.imgur.com/nGF1K8f.jpg'}

I’m using the latest rasa_core version from Github with Python 3.6.5 on a Windows 10 Machine

Is there a way to make this work?

1 Like

Thread can be closed.

Found a solution after reading through the rasa core sdk source code. dispatcher.utter_template("utter_video", tracker, False, image = "https://i.imgur.com/nGF1K8f.jpg")

Does exactly what I needed. Maybe a hint in the documentation of this function would be useful for other people since I discovered some threads with a problem similiar to mine when first googling for the solution.


First of all sorry for commenting on a solved thread. But this even helped me to solve a similar issue/bug. Just here to say a thank you. :smiley:

Regards, Napsa Feknu PLEX . https://tutuappx.com/ . https://vidmate.onl/


Was able to dispatch an image to facebook like the following.

img = "https://my.image.com/image.png"
if tracker.get_latest_input_channel() == 'facebook':
    message = {
        "attachment": {
             "type": "image",
             "payload": {
                 "url": img,
                 "is_reusable": False

Hello @ADPowers , I am using rasa 0.14 , there is no function dispatcher.utter_custom_json() . How did u get that? Which version are u using .

Hi, I’m new to this. I wanted to ask, how you define ‘utter_video’ in domain.yml?

i wanted to ask the same ? any update on the issue ? shareit vidmate

Can you please explain the codes in a bit detail please as I am not able to understand them completely


how you define ‘utter_video’ in domain.yml ? please explain ?jiofi login https://forpc.onl

Hey thanx for sharing the response, it helped me solve my issue.

Thank you.! mybkexperience mcdvoice

this line didn’t help me. i want to show image through custom action not a single line is working ;(

image = ‘https://i.imgur.com/nGF1K8f.jpg’ dispatcher.utter_message(text = “Here is the image that you have created.”, image = image) finally this code help me to show picture

1 Like

I would like to send an image from a custom Action without adding any text and am running into the following issue:

  • when using code like dispatcher.utter_response({"text": "", "image": "https://i.imgur.com/nGF1K8f.jpg"}) I will get an empty text message (i.e. blank line in CLI mode)
  • when I omit the key like dispatcher.utter_response({"image": "https://i.imgur.com/nGF1K8f.jpg"}) nothing at all is sent in response. .