fix(core.gbapp): Fix main NLP problem in Y calls.
This commit is contained in:
parent
537d076e97
commit
c600a91cde
3 changed files with 10 additions and 8 deletions
|
@ -626,7 +626,11 @@ export class GBConversationalService {
|
|||
}
|
||||
}
|
||||
|
||||
public async routeNLP(step: GBDialogStep, min: GBMinInstance, text: string): Promise<boolean> {
|
||||
// TODO: Update botlib.
|
||||
public async routeNLP(step: GBDialogStep, min: GBMinInstance, text: string): Promise<Boolean> {
|
||||
return false;
|
||||
}
|
||||
public async routeNLP2(step: GBDialogStep, min: GBMinInstance, text: string) {
|
||||
if (min.instance.nlpAppId === null || min.instance.nlpAppId === undefined) {
|
||||
return false;
|
||||
}
|
||||
|
@ -713,16 +717,14 @@ export class GBConversationalService {
|
|||
});
|
||||
}
|
||||
|
||||
await step.replaceDialog(`/${intent}`, step.activeDialog.state.options);
|
||||
|
||||
return true;
|
||||
return await step.replaceDialog(`/${intent}`, step.activeDialog.state.options);
|
||||
}
|
||||
|
||||
GBLog.info(
|
||||
`NLP NOT called: score: ${score} > required (nlpScore): ${instanceScore}`
|
||||
);
|
||||
|
||||
return false;
|
||||
return null;
|
||||
}
|
||||
|
||||
public async getLanguage(min: GBMinInstance, text: string): Promise<string> {
|
||||
|
|
|
@ -1242,7 +1242,6 @@ export class GBMinService {
|
|||
|
||||
if (step.activeDialog !== undefined) {
|
||||
await step.continueDialog();
|
||||
|
||||
} else {
|
||||
|
||||
const startDialog = user.hearOnDialog ?
|
||||
|
|
|
@ -256,8 +256,9 @@ export class AskDialog extends IGBDialog {
|
|||
|
||||
// Tries to answer by NLP.
|
||||
|
||||
if (await min.conversationalService.routeNLP(step, min, text)) {
|
||||
return await step.replaceDialog('/ask', { isReturning: true });
|
||||
let nextDialog = await min.conversationalService["routeNLP2"](step, min, text);
|
||||
if (nextDialog) {
|
||||
return nextDialog;
|
||||
}
|
||||
|
||||
// Tries to answer by Reading Comprehension.
|
||||
|
|
Loading…
Add table
Reference in a new issue