1
1
mirror of https://github.com/leon-ai/leon.git synced 2024-12-25 01:31:47 +03:00

fix(server): intent not found

This commit is contained in:
louistiti 2022-02-28 23:06:21 +08:00
parent d5577b1ef5
commit 8280c65897
No known key found for this signature in database
GPG Key ID: 0A1C3B043E70C77D
2 changed files with 4 additions and 3 deletions

View File

@ -96,11 +96,9 @@ class Nlu {
locale, domain, intent, score, answers
} = result
const [skillName, actionName] = intent.split('.')
const { type: skillType } = domainHelper.getSkillInfo(domain, skillName)
let obj = {
utterance,
entities: [],
skillType,
answers, // For dialog skill type
classification: {
domain,
@ -157,6 +155,9 @@ class Nlu {
log.title('NLU')
log.success(`Intent found: ${obj.classification.skill}.${obj.classification.action} (domain: ${obj.classification.domain})`)
const { type: skillType } = domainHelper.getSkillInfo(domain, skillName)
obj.skillType = skillType
try {
obj.entities = await this.ner.extractEntities(
this.brain.lang,

View File

@ -40,7 +40,7 @@
"Alright, here is for the {{ color }} color: {{ color.usage }}."
],
"unknown_answers": [
"This color looks incredible, but I haven't seen it before."
"This color sounds incredible, but I haven't seen it before."
]
},
"why": {