From 0e1c0f08558bc544eebe1d2dcbbc29075a53de3a Mon Sep 17 00:00:00 2001 From: Marian Tietz Date: Wed, 9 Aug 2023 18:11:35 +0200 Subject: [PATCH] Fix OSS-413: Proper intents in interactive training In OSS-413 a user reports that since Rasa 3.1 the interactive training dialogue suggests malformed/shortened intent names, e.g.: - a - b - c This is due to a bug in the parsing of intent names which assumes that every intent is a dictionary (which it is ONLY when a property such as `use_entities` is set). While OSS-413 states that this is solely cosmetic it is an actual bug that caused severe problems that cost several hours to debug: When using the regex matcher it is checked whether the parsed intent is in the domain or not. When it is not, it will fail and attempt to revert the user utterance. The user utterance is then written to the tracker but `SlotSet` events are not repeated - therefore any form validator will fail for inexplicable reasons. This also means that there is a bug in the `_correct_wrong_nlu` for not copying enough or re-starting the `ActionExtractSlots` action which is not addressed here. --- rasa/core/training/interactive.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/rasa/core/training/interactive.py b/rasa/core/training/interactive.py index 860dae007145..78c1b71f6822 100644 --- a/rasa/core/training/interactive.py +++ b/rasa/core/training/interactive.py @@ -1477,7 +1477,11 @@ async def record_messages( domain_intents = domain.get("intents", []) if domain is not None else [] - intents = [next(iter(i)) for i in domain_intents] + intents = [ + next(iter(i)) if isinstance(i, dict) # intent property + else i # plain intent name + for i in domain_intents + ] num_messages = 0