mirror of
https://github.com/leon-ai/leon.git
synced 2024-09-11 18:27:21 +03:00
refactor(server): actions to fallbacks
This commit is contained in:
parent
5cf77d9011
commit
4d929dc4fa
@ -13,7 +13,8 @@
|
|||||||
{
|
{
|
||||||
"words": ["merci"],
|
"words": ["merci"],
|
||||||
"package": "leon",
|
"package": "leon",
|
||||||
"module": "welcome"
|
"module": "welcome",
|
||||||
|
"action": "run"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@ -148,6 +148,7 @@ class Nlu {
|
|||||||
if (JSON.stringify(tmpWords) === JSON.stringify(fallbacks[i].words)) {
|
if (JSON.stringify(tmpWords) === JSON.stringify(fallbacks[i].words)) {
|
||||||
obj.classification.package = fallbacks[i].package
|
obj.classification.package = fallbacks[i].package
|
||||||
obj.classification.module = fallbacks[i].module
|
obj.classification.module = fallbacks[i].module
|
||||||
|
obj.classification.action = fallbacks[i].action
|
||||||
obj.classification.confidence = 1
|
obj.classification.confidence = 1
|
||||||
|
|
||||||
log.success('Fallback found')
|
log.success('Fallback found')
|
||||||
|
@ -94,8 +94,8 @@ describe('NLU', () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
expect(Nlu.fallback(obj, [
|
expect(Nlu.fallback(obj, [
|
||||||
{ words: ['query', 'example', 'test', 'fallbacks'], package: 'fake-pkg', module: 'fake-module' }
|
{ words: ['query', 'example', 'test', 'fallbacks'], package: 'fake-pkg', module: 'fake-module', action: 'fake-action' }
|
||||||
]).classification).toContainEntries([['package', 'fake-pkg'], ['module', 'fake-module'], ['confidence', 1]])
|
]).classification).toContainEntries([['package', 'fake-pkg'], ['module', 'fake-module'], ['action', 'fake-action'], ['confidence', 1]])
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user