But the rasa interactive command is working normaly. I checked parameters of output in file rasa\nlu\run.py . And it’s OK print(json_to_string(result))
I trained my model with rasa train.
Why my bot print in unicode and json in rasa shell?
Rasa 2.8.21, Rasa SDK 2.8.4, Python 3.8.12, Linux Manjaro
@nik202, no, I run my bot for check how it answer and build dialoges. I do it in terminal, command rasa shell
I see the message: Your input -> and type the message
Bot answer to me in json and unicode instead of text
@faupotron I am not doubting your understanding, it’s my way of providing the solution, as this error is regarding UTF-8, etc regarding that why I asked.
@faupotron did you create the env for installation Rasa?
You are looking in the wrong place.
the rasa/nlu/run is used in rasa shell nlu, and it is using json.dumps(..., ensure_ascii=False,...) by default.
The key here is ensure_ascii to be false, because otherwise all unicode, non-ascii, characters will be encoded as shown in your example.
rasa shell uses the commandline channel, which uses rasa.core.channels.console._print_bot_output(message,....) which uses json.dumps(message["custom"], indent=2), color=color in the last but one line. There is no ensure_ascii=False parameter here, so it defaults to True which means all non ASCII-7 characters will be escaped.
So you can’t do anything about it unless you change that line of Rasa code.
@raoulvm, hello! Thank you for answer. You gave me the right direction. I found a function that is responsible for the output in the rasa shell in the file rasa/core/channels/console.py
I added the strings: