Rasa X collapsing sequences of whitespace from custom action message

OS: Ubuntu 20.04 LTS x86 64bit

Browser: Firefox 83.0

Rasa: 2.1.3

Rasa X: 2.1.2

Rasa SDK: 0.34.0

Python: 3.8.5


Hi all,

I am working on a project where users can query for coin prices with a chatbot.

I have a function in python which handles parsing user input and returns a price table formatted with string formatting to have the columns be as wide as the widest object. Here is some example code for that so you know what I am talking about

row = f'%-{max_len + 2}s%-{max_len + 2}s%-{max_len + 2}s\n' % (grade, price0, price1)

when using $ rasa shell I have no trouble seeing the table as intended:

But when I run the same model in Rasa X I get the table all wonky looking, and it looks like the sequences of whitespace are collapsed

I guess my question is either:

  1. how can I fix this so that when I have users test my system it does not look so off, or
  2. what is a better way to render tables in output to a user?

Thanks!

Ryan

If anybody is interested in this I ended up using the PIL library in python to draw the table string to a png file that is temporarily saved and displayed before being deleted.

Some helpful resources for that:

Local images still having trouble displaying in Rasa X, see this github issue

marking as unsolved