Bot utterance fails: _utter_responses sets text to None by updating dict values
See original GitHub issueRasa version: 1.5.0
Python version: 3.6.8
Operating system: Windows 10
Issue:
The rasa.core.processor ends processing with:
BotUttered(text: None, data: {"elements": [], "quick_replies": null, "buttons": null, "attachment": null, "image": null, "custom": null}, metadata: {"caller_number_permission": null, "fullname": null, "permission": null, "phonenumber": null, "purpose": null, "requested_slot": null})
although a template has been generated by an external action server. After investigating the
@staticmethod
async def _utter_responses(
method of rasa.core.actions.action.py I observed that if there is a template in the response, the method iterates over, the draft is built correctly. A few lines later, the draft dictionary is updated on the formerly used response which means that the 'text' key of draft, that has previously been filled with the utterance, is now overwritten with the None value of the response.
As far as I have seen, we could possibly change the implementation such that we say:
response.update(draft)
bot_messages.append(create_bot_utterance(response))
since in draft lies the result of the response-processing, separated from the original. I tested it and it worked properly but maybe there are some consequences I might not see atm.
Regards Julian
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (5 by maintainers)

Top Related StackOverflow Question
Haha, no problem. Thanks so much for reporting, I’m sure we got this stuff fixed a lot faster than if you hadn’t!
Hi @erohmensing,
you were a second quicker than me - already checked - it was solved! 😃
Thanks a lot to you and the team!
Regards