Adding cardsCarousel

Hello Community,

I’m trying to add a simple carousel as an action to my code, but I can’t. Can you help me finding what I’m doing wrong?

Here is the code I am using in actions.py:

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]]:
            
            test_carousel=[]
            item={}

            item["title"]='Service A'
            item["image_url"]='https://images.unsplash.com/photo-1489278353717-f64c6ee8a4d2?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1050&q=80'

            test_carousel.append(item)

            print(test_carousel, type(test_carousel))
            dispatcher.utter_message(text="Hi!",json_message={"payload":"cardsCarousel","data":test_carousel})

            return []

Hi Fernando,

This looks like a custom payload. Are you using a channel that supports this type of payload?

Greg

Hi @stephens,

Actually, I’m not using any channel. Just trying to see it working through my Rasa X.

Do I need to set a channel in order to use a carousel?

Thanks in Advance

Rasa X doesn’t support carousel’s. You’ll need to use a channel that support carousels. I think the Facebook channel does this.

Thanks @stephens I will try to connect the Rasa X to Facebook channel.

It’s Rasa OSS that you’ll connect to Facebook. If you’re using the docker-compose setup, it’s the rasa-production container that you’ll be connecting to, not the rasa-x. Config details are here

Hi @stephens,

Can you help me with that issue?

Thanks