Rasa: Bot utterance fails: _utter_responses sets text to None by updating dict values

Created on 27 Nov 2019  路  6Comments  路  Source: RasaHQ/rasa

Rasa 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 Nonevalue 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

type

All 6 comments

Thanks for the issue, @TyDunn will get back to you about it soon!

You may find help in the docs and the forum, too 馃

@JulianGerhard21 will you check this one on 1.5.1 as well?

Hi @erohmensing,

you were a second quicker than me - already checked - it was solved! :-)

Thanks a lot to you and the team!

Regards

Haha, no problem. Thanks so much for reporting, I'm sure we got this stuff fixed a lot faster than if you hadn't!

You're welcome, as always.

Anything else that is pressing at the moment where I might have a look at?

Regards

Not that I can think of! I'm sure if there are any more release-related fires, there will be new github/forum issues to that point very soon 馃槄

Was this page helpful?
0 / 5 - 0 ratings