Skip to content

Commit

Permalink
Little improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
hinojosachapel committed Feb 28, 2020
1 parent 85aa8f4 commit 0b38255
Show file tree
Hide file tree
Showing 10 changed files with 44 additions and 78 deletions.
4 changes: 2 additions & 2 deletions javascript_nodejs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@
"hostname": "https://your-qnamaker-app-name.azurewebsites.net/qnamaker"
},
"cosmosDb": {
"serviceEndpoint": "https://your-cosmosdb-account-name.documents.azure.com:443/",
"cosmosDbEndpoint": "https://your-cosmosdb-account-name.documents.azure.com:443/",
"authKey": "<YOUR_AUTHORING_KEY>",
"databaseId": "<YOUR_DATABASE_ID>",
"collectionId": "<YOUR_COLLECTION_ID>"
"containerId": "<YOUR_COLLECTION_ID>"
},
"publicResourcesUrl": "http://localhost:3978"
}
Expand Down
41 changes: 11 additions & 30 deletions javascript_nodejs/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions javascript_nodejs/src/dialogs/chitchat/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,8 @@ class ChitchatDialog extends ComponentDialog {
return true;
}

// This is a special case that leads to a new dialog,
// so it's not handled as a normal interruption flow.
await dc.beginDialog(CancelDialog.name);
return false;
return true;
}

/**
Expand Down
8 changes: 6 additions & 2 deletions javascript_nodejs/src/dialogs/main/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,12 @@ class MainDialog extends ComponentDialog {

if (interrupted) {
if (dc.activeDialog) {
// issue a re-prompt on the active dialog
await dc.repromptDialog();
// issue a re-prompt on the active dialog if it's not Cancel dialog
if (dc.activeDialog.id !== CancelDialog.name) {
await dc.repromptDialog();
} else {
turnResult = await dc.continueDialog();
}
} // Else: We don't have an active dialog so nothing to continue here.
} else {
// No interruption. Continue any active dialogs.
Expand Down
4 changes: 2 additions & 2 deletions javascript_nodejs/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const localizer = require('i18n');
// Import required bot services. See https://aka.ms/bot-services to learn more about the different parts of a bot.
const { BotFrameworkAdapter, MemoryStorage, ConversationState, UserState } = require('botbuilder');
const { LuisRecognizer, QnAMaker } = require('botbuilder-ai');
const { CosmosDbStorage } = require('botbuilder-azure');
const { CosmosDbPartitionedStorage } = require("botbuilder-azure");

// Avoid uploading sensitive information like appsettings.json file to your source code repository.
// .gitignore file contains appsettings.json as an ignored file.
Expand Down Expand Up @@ -73,7 +73,7 @@ if (NODE_ENV === DEV_ENV) {
// is restarted, anything stored in memory will be gone.
storage = new MemoryStorage();
} else {
storage = new CosmosDbStorage(appsettings.cosmosDb);
storage = new CosmosDbPartitionedStorage(appsettings.cosmosDb);
}

conversationState = new ConversationState(storage);
Expand Down
4 changes: 2 additions & 2 deletions typescript_nodejs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@
"hostname": "https://your-qnamaker-app-name.azurewebsites.net/qnamaker"
},
"cosmosDb": {
"serviceEndpoint": "https://your-cosmosdb-account-name.documents.azure.com:443/",
"cosmosDbEndpoint": "https://your-cosmosdb-account-name.documents.azure.com:443/",
"authKey": "<YOUR_AUTHORING_KEY>",
"databaseId": "<YOUR_DATABASE_ID>",
"collectionId": "<YOUR_COLLECTION_ID>"
"containerId": "<YOUR_COLLECTION_ID>"
},
"publicResourcesUrl": "http://localhost:3978"
}
Expand Down
41 changes: 11 additions & 30 deletions typescript_nodejs/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 0b38255

Please sign in to comment.