Skip to content

Commit

Permalink
fix(NLP): Update of platform to mach NLP URL updates and versioning.
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigorodriguez committed Feb 28, 2019
1 parent fd39b1d commit 6588049
Show file tree
Hide file tree
Showing 7 changed files with 144 additions and 407 deletions.
484 changes: 103 additions & 381 deletions package-lock.json

Large diffs are not rendered by default.

40 changes: 21 additions & 19 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,13 @@
"azure-arm-website": "5.7.0",
"bluebird": "^3.5.3",
"body-parser": "1.18.3",
"botbuilder": "^4.2.1",
"botbuilder-ai": "^4.2.1",
"botbuilder-azure": "^4.2.1",
"botbuilder-choices": "^4.0.0-preview1.2",
"botbuilder-dialogs": "^4.2.1",
"botbuilder-prompts": "^4.0.0-preview1.2",
"botlib": "^0.1.12",
"botbuilder": "4.1.7",
"botbuilder-ai": "4.2.0",
"botbuilder-azure": "4.2.0",
"botbuilder-choices": "4.0.0-preview1.2",
"botbuilder-dialogs": "4.2.0",
"botbuilder-prompts": "4.0.0-preview1.2",
"botlib": "0.1.19",
"chai": "4.2.0",
"child_process": "^1.0.2",
"chokidar": "2.1.2",
Expand All @@ -80,32 +80,34 @@
"js-beautify": "^1.8.9",
"localize": "0.4.7",
"marked": "0.6.1",
"mocha": "6.0.1",
"mocha": "6.0.2",
"mocha-typescript": "1.1.17",
"ms": "2.1.1",
"ms-rest-azure": "2.6.0",
"nexmo": "2.4.1",
"ngrok": "^3.1.1",
"nyc": "^13.3.0",
"opn": "^5.4.0",
"ngrok": "3.1.1",
"nyc": "13.3.0",
"opn": "5.4.0",
"pragmatismo-io-framework": "1.0.19",
"process-exists": "^3.1.0",
"process-exists": "3.1.0",
"public-ip": "^3.0.0",
"reflect-metadata": "0.1.13",
"request-promise": "4.2.4",
"request-promise-native": "1.0.7",
"scanf": "^1.0.2",
"sequelize": "4.42.0",
"sequelize": "4.42.1",
"sequelize-typescript": "0.6.7",
"shx": "^0.3.2",
"simple-git": "^1.107.0",
"shx": "0.3.2",
"simple-git": "1.107.0",
"sqlite3": "4.0.6",
"strict-password-generator": "^1.1.2",
"swagger-client": "3.8.24",
"swagger-client": "3.8.25",
"tedious": "5.0.3",
"temperature-js": "^0.1.0",
"ts-node": "8.0.2",
"typedoc": "0.14.2",
"typedoc-plugin-external-module-name": "^2.0.0",
"typedoc-plugin-markdown": "^1.1.26",
"typedoc-plugin-markdown": "^1.1.27",
"typescript": "3.3.3333",
"url-join": "4.0.0",
"vbscript-to-typescript": "^1.0.8",
Expand All @@ -122,7 +124,7 @@
"@semantic-release/release-notes-generator": "^7.1.4",
"@types/chai": "4.1.7",
"@types/mocha": "5.2.6",
"@types/sequelize": "4.27.37",
"@types/sequelize": "4.27.38",
"@types/url-join": "4.0.0",
"@types/winston": "2.4.4",
"ban-sensitive-files": "1.9.2",
Expand All @@ -140,7 +142,7 @@
"standard": "12.0.1",
"travis-deploy-once": "5.0.11",
"ts-loader": "^5.3.3",
"tslint": "^5.12.1",
"tslint": "^5.13.0",
"tslint-microsoft-contrib": "^6.0.0"
},
"eslintConfig": {
Expand Down
3 changes: 3 additions & 0 deletions packages/azuredeployer.gbapp/dialogs/StartDialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@ export class StartDialog {
authoringKey = this.retrieveAuthoringKey();
}

process.stdout.write(`${GBAdminService.GB_PROMPT}Thank you. That is enough information.\nNow building farm...`);


// Prepares the first instance on bot farm.
const instance: IGBInstance = {};

Expand Down
6 changes: 4 additions & 2 deletions packages/core.gbapp/services/GBConversationalService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,12 @@ export class GBConversationalService implements IGBConversationalService {
public async routeNLP(step: any, min: GBMinInstance, text: string): Promise<boolean> {
// Invokes LUIS.

let endpoint = min.instance.nlpEndpoint.replace('/luis/v2.0', '');

const model = new LuisRecognizer({
applicationId: min.instance.nlpAppId,
endpointKey: min.instance.nlpKey,
endpoint: min.instance.nlpEndpoint
endpoint: endpoint
});

let nlp: any;
Expand Down Expand Up @@ -130,7 +132,7 @@ export class GBConversationalService implements IGBConversationalService {
logger.info(`NLP called: ${intent}, ${entity}`);

try {
await step.replace(`/${intent}`, nlp.entities);
await step.replaceDialog(`/${intent}`, nlp.entities);

return Promise.resolve(true);
} catch (error) {
Expand Down
1 change: 1 addition & 0 deletions packages/core.gbapp/services/GBCoreService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ import { GBWhatsappPackage } from '../../whatsapp.gblib/index';
import { GuaribasInstance } from '../models/GBModel';
import { GBConfigService } from './GBConfigService';
import { StartDialog } from '../../azuredeployer.gbapp/dialogs/StartDialog';
import { WaterfallDialog } from 'botbuilder-dialogs';

const logger = require('../../../src/logger');
const opn = require('opn');
Expand Down
15 changes: 10 additions & 5 deletions packages/core.gbapp/services/GBMinService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const AuthenticationContext = require('adal-node').AuthenticationContext;

import { AutoSaveStateMiddleware, BotFrameworkAdapter, ConversationState, MemoryStorage, UserState } from 'botbuilder';

import { ConfirmPrompt } from 'botbuilder-dialogs';
import { ConfirmPrompt, WaterfallDialog } from 'botbuilder-dialogs';
import { GBMinInstance, IGBAdminService, IGBConversationalService, IGBCoreService, IGBPackage } from 'botlib';
import { GBAnalyticsPackage } from '../../analytics.gblib';
import { GBCorePackage } from '../../core.gbapp';
Expand Down Expand Up @@ -356,9 +356,15 @@ export class GBMinService {
}
}, this);

appPackages.forEach(e => {
e.sysPackages = sysPackages;
e.loadBot(min);
appPackages.forEach(p => {
p.sysPackages = sysPackages;
p.loadBot(min);
if (p.getDialogs !== undefined) {
let dialogs = p.getDialogs(min);
dialogs.forEach(dialog => {
min.dialogs.add(new WaterfallDialog(dialog.name, dialog.waterfall));
});
}
}, this);
}

Expand Down Expand Up @@ -473,7 +479,6 @@ export class GBMinService {
let isVMCall = Object.keys(min.scriptMap).find(key => min.scriptMap[key] === context.activity.text) !== undefined;

if (isVMCall) {

let mainMethod = context.activity.text;

min.sandbox.context = context;
Expand Down
2 changes: 2 additions & 0 deletions packages/kb.gbapp/dialogs/AskDialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,5 +204,7 @@ export class AskDialog extends IGBDialog {
}
])
);


}
}

0 comments on commit 6588049

Please sign in to comment.