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
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
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
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.
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
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..