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
@nik202 I’ve understood. Of course, I use custom actions. It’s in .yml files (not .csv).
rasa --version:
Rasa Version : 2.8.21
Minimum Compatible Version: 2.8.9
Rasa SDK Version : 2.8.4
Rasa X Version : None
Python Version : 3.8.12
Operating System : Linux-5.4.181-1-MANJARO-x86_64-with-glibc2.17
@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?
@nik202 rasa\nlu\run.py is file from rasa module. It’s located ~/miniconda3/envs/rasa2/lib/python3.8/site-packages/rasa/nlu/
I just finded the same issue and checked this file. But I don’t change it
You only shared the below piece of information but not with the complete path, for me it can be any custom code.
Anyways you are using Miniconda3 and I never used that, I always use anaconda3 for creating a virtual environment, and it’s giving me great results without any issue.
Hi @faupotron
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: