fix(core.gbapp): Fix main NLP problem in Y calls.

This commit is contained in:
Rodrigo Rodriguez 2021-09-14 15:10:46 -03:00
parent 537d076e97
commit c600a91cde
3 changed files with 10 additions and 8 deletions

View file

@ -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) { if (min.instance.nlpAppId === null || min.instance.nlpAppId === undefined) {
return false; return false;
} }
@ -713,16 +717,14 @@ export class GBConversationalService {
}); });
} }
await step.replaceDialog(`/${intent}`, step.activeDialog.state.options); return await step.replaceDialog(`/${intent}`, step.activeDialog.state.options);
return true;
} }
GBLog.info( GBLog.info(
`NLP NOT called: score: ${score} > required (nlpScore): ${instanceScore}` `NLP NOT called: score: ${score} > required (nlpScore): ${instanceScore}`
); );
return false; return null;
} }
public async getLanguage(min: GBMinInstance, text: string): Promise<string> { public async getLanguage(min: GBMinInstance, text: string): Promise<string> {

View file

@ -1242,7 +1242,6 @@ export class GBMinService {
if (step.activeDialog !== undefined) { if (step.activeDialog !== undefined) {
await step.continueDialog(); await step.continueDialog();
} else { } else {
const startDialog = user.hearOnDialog ? const startDialog = user.hearOnDialog ?

View file

@ -256,8 +256,9 @@ export class AskDialog extends IGBDialog {
// Tries to answer by NLP. // Tries to answer by NLP.
if (await min.conversationalService.routeNLP(step, min, text)) { let nextDialog = await min.conversationalService["routeNLP2"](step, min, text);
return await step.replaceDialog('/ask', { isReturning: true }); if (nextDialog) {
return nextDialog;
} }
// Tries to answer by Reading Comprehension. // Tries to answer by Reading Comprehension.