Added data sent to the handlers (+fix utterance list/str)

This commit is contained in:
Mathieu B 2021-07-29 23:02:43 +02:00
parent d7163ac7de
commit 568f6a3fce

View File

@ -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")