This is an error I’m getting in the Rasa Shell. I can’t change that (unless I start changing Rasa code).
However, after more investigation, I think I should be using “json_message” in my dispatcher.utter_message. and not “attachment” i.e. I think it’s a bug in the Botfront RASA UI not picking up the correct attribute.
The code I use is in my first post. This works with the Botfront UI. When I run this in “rasa shell” I get this error:
2021-10-28 23:30:09 ERROR asyncio - Task exception was never retrieved
future: <Task finished coro=<configure_app.<locals>.run_cmdline_io() done, defined at /home/pomegran/rasa270/rasa270env/lib/python3.6/site-packages/rasa/core/run.py:131> exception=TypeError('must be str, not dict',)>
Traceback (most recent call last):
File "/home/pomegran/rasa270/rasa270env/lib/python3.6/site-packages/rasa/core/run.py", line 137, in run_cmdline_io
sender_id=conversation_id,
File "/home/pomegran/rasa270/rasa270env/lib/python3.6/site-packages/rasa/core/channels/console.py", line 172, in record_messages
text = get_user_input(previous_response)
File "/home/pomegran/rasa270/rasa270env/lib/python3.6/site-packages/rasa/core/channels/console.py", line 97, in get_user_input
button_response = print_bot_output(previous_response, is_latest_message=True)
File "/home/pomegran/rasa270/rasa270env/lib/python3.6/site-packages/rasa/core/channels/console.py", line 70, in print_bot_output
"Attachment: " + message.get("attachment"), color=color
TypeError: must be str, not dict
I honestly think the Botfront Chatbot needs to be modified to pick up “json_message” and not “attachment”.
It’s not a big problem. I have coded around this (I can detect using metadata if an input comes from the Botfront UI or not) and used the appropriate “attachment” or “json_message” attribute appropriately.
I changed from “response” to “template” by the way and the error is identical.