From 568f6a3fce07140a67988ade04ff6dcaf278e38e Mon Sep 17 00:00:00 2001 From: Mathieu B Date: Thu, 29 Jul 2021 23:02:43 +0200 Subject: [PATCH] Added data sent to the handlers (+fix utterance list/str) --- jarvis/skills/intent_manager.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/jarvis/skills/intent_manager.py b/jarvis/skills/intent_manager.py index 2de0e61..a9b0a5c 100644 --- a/jarvis/skills/intent_manager.py +++ b/jarvis/skills/intent_manager.py @@ -77,6 +77,13 @@ def recognise(sentence): # print(result) # DEBUG if result.conf >= 0.2: - handle(result.name, [result.matches, result.sent]) + data = dict() + if isinstance(result.sent, list): + data['utterance'] = " ".join( + result.sent) # add the sentence (utterance) to the data given to the intent handler + else: + data['utterance'] = result.sent + data.update(result.matches) # adding the matches from padatious to the data + handle(result.name, data) else: print("No match... (Padatious")