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