Markup/Styling in responses

Hey,

this is a multi-part question to some degree. The main question is if there is any documentation on which markup tags are supported by rasa x to style messages of the chatbot. I am specifically talking about the assistant that can be shared with the guest testers.

I have already played around a bit with the rasa-webchat repository which works quite well. Now unfortunately the markup styling that works here will not with rasa x (to some degree). To summarize the things I try to get to work in rasa x:

Linebreaks

responses:
     utter_ask_a_problem:
         - text: |
              **1. Description of the problem** 
             Here is a small text about why we need this slot and what the user should describe. We want a 
             linebreak between the headline and the text so it looks clean.

This example works fine with rasa-webchat. If I use two line breaks after the headline it even splits the text into two message bubbles which is awesome. However with rasa x there is no line break at all, it is just one continuous text. I have also tried a headline tag with “# 1. Description of the problem” but then it doesn’t show the headline at all.

Multiple bubbles

I have already seen some posts in this forum and so far the recommendation is to split the utterance and either call it through a custom action or in the stories. Now my issue with that is that the utterance I want to split is part of a form. What would be the best approach here?

forms:
    form_problem:
        required_slots:
            - a_problem

response:
    utter_ask_a_problem:
        - text: |
              Nice multiline, multibubble, crazy styling text.

It would be perfect if there is a way for some styling in the assistant that can be shared with testers. Otherwise, I fear that the behavior of the users might differ from the “real” application, as bad formatting makes it hard to understand what the chatbot is saying.

I’m not sure if we support general markdown rendering because it depends on the output channel. A web front-end could surely handle the markdown rendering theoretically but facebook messenger, whatsapp or slack might not offer full support for this. If you had your own front-end you would be able to parse it any way you like though.

On the topic of having two chat bubbles appear, you could send two responses in sequence to each other. Won’t that suffice? You would need to add extra responses to your story files, but it would help keep the conversation composable into smaller chunks.

1 Like

In regards to the rendering, I think some documentation which rendering is supported by the web front-end of rasa-x would have helped me. For example bold text works, headlines do not, so I was just wondering… Anyhow like you said I will use my own front-end now.

In regards to the two chat bubbles, I don’t understand what you mean with two responses in sequence. Could you give a simple example for a slot in a form where the ask utterance is split?

Because from my understanding I define a slot the_slot and an utterance ask_the_slot. How can I split that utterance? I do not see the connection to my story files.

You can use dispatcher.utter_message() twice to send two messages in any type of Action, including action_ask_slotname.