Skip to content

Commit

Permalink
fix(core.gbapp): MSFT NLP issue fixed.
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigorodriguez committed Dec 6, 2020
1 parent 26c34e3 commit 149c821
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions packages/core.gbapp/services/GBConversationalService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -523,6 +523,20 @@ export class GBConversationalService {

try {
step.activeDialog.state.options.entities = nlp.entities;

// FIX MSFT NLP issue.

if (nlp.entities) {
await CollectionUtil.asyncForEach(Object.keys(nlp.entities), async key => {
if (key !== "$instance") {
let entity = nlp.entities[key];
if (Array.isArray(entity[0])) {
nlp.entities[key] = entity.slice(1);
}
}
});
}

await step.replaceDialog(`/${intent}`, step.activeDialog.state.options);

return true;
Expand Down

0 comments on commit 149c821

Please sign in to comment.