Merge pull request #195 from Microsoft/develop

Merge develop into master
This commit is contained in:
Matt Mazzola 2018-05-17 17:22:20 -07:00 коммит произвёл GitHub
Родитель 8299f480b7 a78db135c0
Коммит 5ebbbdc279
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
21 изменённых файлов: 3378 добавлений и 897 удалений

Просмотреть файл

@ -22,7 +22,7 @@ CONVERSATION_LEARNER_BOT_PORT=3978
CONVERSATION_LEARNER_UI_PORT=5050
CONVERSATION_LEARNER_SDK_PORT=5000
# When localhost is true conversationlearner-sdk will start DOL server
# When localhost is true @conversationlearner/sdk will start DOL server
CONVERSATION_LEARNER_LOCALHOST=true
DOL_BOT_URL=http://127.0.0.1:3978/api/messages
DOL_SERVICE_URL=http://127.0.0.1:3000
@ -31,7 +31,7 @@ DOL_SERVICE_URL=http://127.0.0.1:3000
MICROSOFTAPPID=
MICROSOFTAPPPASSWORD=
# By default conversationlearner-sdk will store Bot memory/state in local memory storage.
# By default @conversationlearner/sdk will store Bot memory/state in local memory storage.
# To run the Redis storage demo (demoStorage.ts) add the server uri and key
CONVERSATION_LEARNER_REDIS_SERVER=
CONVERSATION_LEARNER_REDIS_KEY=

1
.npmrc
Просмотреть файл

@ -1 +0,0 @@
registry=http://bbnpm.azurewebsites.net/

5
.vscode/settings.json поставляемый
Просмотреть файл

@ -1,3 +1,6 @@
{
"typescript.tsdk": "node_modules/typescript/lib"
"typescript.tsdk": "node_modules/typescript/lib",
"workbench.colorCustomizations": {
"activityBar.background": "#065219"
}
}

Просмотреть файл

@ -4,7 +4,7 @@ This repo contains sample code for building task-oriented conversational bots us
Project Conversation Learner enables you to build and teach task-oriented conversational interfaces that learn from example interactions, combining code, logical constraints and machine learning. Certain absolute parts of your application such as checking if the user is logged in or making an API request to check store inventory can still be coded; however, other changes in state and action selection can be learned from example dialogs given by the domain expert or developer.
This README explains how to get started; full documentation is availble [here](https://docs.microsoft.com/en-us/azure/cognitive-services/Labs/Conversation-Learner/).
This README explains how to get started; full documentation is available [here](https://docs.microsoft.com/en-us/azure/cognitive-services/Labs/Conversation-Learner/).
## Invitation required
@ -61,7 +61,7 @@ Project Conversation Learner consists of an SDK you add to your bot, and a cloud
npm start
```
This runs the generic empty bot in ``my-bot-01/src/app.ts``.
This runs the generic empty bot in `my-bot-01/src/app.ts`.
3. Run Conversation Learner UI:
@ -106,11 +106,11 @@ Source files for the demos are in `my-bot-01/src/demos`
## Create a bot which includes back-end code
1. If you have the Converstaion Learner web UI open, return to the list of apps at http://localhost:5050/home.
1. If you have the Conversation Learner web UI open, return to the list of apps at http://localhost:5050/home.
2. If a bot is running (like `npm run demo-pizza`), stop it. You do not need to stop the UI process, or close the web browser.
3. If desired, edit code in ``blis-bot-01/src/app.ts``.
3. If desired, edit code in `my-bot-01/src/app.ts`.
4. Rebuild and re-start bot:
@ -119,15 +119,15 @@ Source files for the demos are in `my-bot-01/src/demos`
npm start
```
5. If you're not already, switch to the Converstaion Learner web UI in Chrome by loading http://localhost:5050/home.
5. If you're not already, switch to the Conversation Learner web UI in Chrome by loading http://localhost:5050/home.
6. Create a new Converstaion Learner application in the UI, and start teaching.
6. Create a new Conversation Learner application in the UI, and start teaching.
7. To make code changes in ``blis-bot-01/src/app.ts``, repeat the steps above, starting from step 2.
7. To make code changes in `my-bot-01/src/app.ts`, repeat the steps above, starting from step 2.
## VSCode
In VSCode, there are run configurations for each demo, and for the "Empty bot" in ``my-bot-01/src/app.ts``. Open the `my-bot-01` folder in VSCode.
In VSCode, there are run configurations for each demo, and for the "Empty bot" in `my-bot-01/src/app.ts`. Open the `my-bot-01` folder in VSCode.
## Advanced configuration
@ -150,7 +150,7 @@ Ensure that these variables are set when deploying your bot:
Environment variable | Setting
--- | ---
CONVERSATION_LEARNER_SERVICE_URI | https://westus.api.cognitive.microsoft.com/conversationlearner/v1.0/
CONVERSATION_LEARNER_APP_ID | Application Id GUID, obtained from the Converstaion Learner UI under the "settings" for the app
CONVERSATION_LEARNER_APP_ID | Application Id GUID, obtained from the Conversation Learner UI under the "settings" for the app
LUIS_AUTHORING_KEY | LUIS authoring key for this app, obtained from https://www.luis.ai
MICROSOFT_APP_ID | Microsoft Application Id
MICROSOFT_APP_PASSWORD | Microsoft Application Password
@ -165,11 +165,13 @@ Once the bot is deployed and running you can connect different channels to it su
## Contributing
When submitting PR's please target the 'develop' branch unless it is a hotfix for 'master'
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
## Related repositories
- [conversationlearner-sdk](https://github.com/Microsoft/ConversationLearner-SDK)
- [conversationlearner-ui](https://github.com/Microsoft/ConversationLearner-UI)
- [conversationlearner-models](https://github.com/Microsoft/ConversationLearner-Models)
- [conversationlearner-webchat](https://github.com/Microsoft/ConversationLearner-WebChat)
- [@conversationlearner/sdk](https://github.com/Microsoft/ConversationLearner-SDK)
- [@conversationlearner/ui](https://github.com/Microsoft/ConversationLearner-UI)
- [@conversationlearner/models](https://github.com/Microsoft/ConversationLearner-Models)
- [@conversationlearner/webchat](https://github.com/Microsoft/ConversationLearner-WebChat)

Просмотреть файл

@ -23,8 +23,8 @@ Conversation Learner reduces the complexity of building bots. It enables a hybr
1. Install:
git clone https://github.com/Microsoft/ConversationLearner-Samples cl-bot-01
cd cl-bot-01
git clone https://github.com/Microsoft/ConversationLearner-Samples my-bot-01
cd my-bot-01
npm install
@ -36,12 +36,12 @@ Conversation Learner reduces the complexity of building bots. It enables a hybr
npm start
This runs the generic empty bot in ``cl-bot-01/src/app.ts``.
This runs the generic empty bot in ``my-bot-01/src/app.ts``.
3. Run the web UI:
[open second command prompt window]
cd cl-bot-01
cd my-bot-01
npm run ui
@ -80,11 +80,11 @@ The instructions above started the generic empty bot. To run a tutorial or demo
7. Click on the demo model in the web UI that corresponds to the demo you started.
Source files for the demos are in `cl-bot-01/src/demos`
Source files for the demos are in `my-bot-01/src/demos`
## VSCode
In VSCode, there are run configurations for each demo, and for the "Empty bot" in ``cl-bot-01/src/app.ts``. Open the `cl-bot-01` folder in VSCode.
In VSCode, there are run configurations for each demo, and for the "Empty bot" in ``my-bot-01/src/app.ts``. Open the `my-bot-01` folder in VSCode.
## Advanced configuration
@ -108,5 +108,6 @@ Join the [Conversation Learner team](https://microsoft-my.sharepoint.com/:v:/p/j
## Related repositories
- [conversationlearner-sdk](https://github.com/Microsoft/ConversationLearner-SDK)
- [conversationlearner-models](https://github.com/Microsoft/ConversationLearner-UI)
- [@conversationlearner/sdk](https://github.com/Microsoft/ConversationLearner-SDK)
- [@conversationlearner/ui](https://github.com/Microsoft/ConversationLearner-UI)
- [@conversationlearner/models](https://github.com/Microsoft/ConversationLearner-Models)

4148
package-lock.json сгенерированный

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -6,6 +6,8 @@
"main": "./lib/app.js",
"scripts": {
"build": "tsc",
"lint": "tslint -t codeFrame 'src/**/*.ts' 'test/**/*.ts'",
"nodemon": "nodemon",
"prestart": "npm run build",
"start": "node ./lib/app.js",
"startnobuild": "node ./lib/app.js",
@ -13,6 +15,7 @@
"tsc": "tsc",
"ui": "node ./lib/ui.js",
"verifypackagelock": "tsc -p ./scripts/tsconfig.json && node ./scripts/verifypackagelock.js",
"watch": "concurrently --kill-others -p [{name}-{pid}] -n tsc,bot \"tsc -w\" \"nodemon\"",
"demo-password": "node ./lib/demos/demoPasswordReset.js",
"demo-pizza": "node ./lib/demos/demoPizzaOrder.js",
"demo-storage": "node ./lib/demos/demoStorage.js",
@ -25,19 +28,32 @@
"author": "Microsoft Conversation Learner Team",
"license": "MIT",
"dependencies": {
"botbuilder": "4.0.0-m4.0",
"conversationlearner-sdk": "0.227.0",
"@conversationlearner/sdk": "0.253.0",
"botbuilder": "4.0.0-preview1.1",
"convict": "^4.0.2",
"dotenv": "^4.0.0",
"restify": "^6.3.2",
"tslint": "^5.8.0"
"restify": "^6.3.2"
},
"devDependencies": {
"@types/convict": "^4.1.1",
"@types/execa": "^0.8.1",
"@types/express": "^4.11.0",
"@types/restify": "^5.0.7",
"concurrently": "^3.5.1",
"execa": "^0.9.0",
"nodemon": "^1.17.3",
"tslint": "^5.8.0",
"tslint-microsoft-contrib": "^5.0.3",
"typescript": "^2.6.2"
},
"engines": {
"node": "8.8.0"
},
"nodemonConfig": {
"watch": [
"lib",
"cards"
],
"delay": "500"
}
}

Просмотреть файл

@ -7,7 +7,7 @@ import * as path from 'path'
import * as restify from 'restify'
import * as BB from 'botbuilder'
import { BotFrameworkAdapter } from 'botbuilder'
import { ConversationLearner, ICLOptions, ClientMemoryManager, models, FileStorage } from 'conversationlearner-sdk'
import { ConversationLearner, ICLOptions, ClientMemoryManager, models, FileStorage } from '@conversationlearner/sdk'
import config from './config'
console.log(`Config: `, JSON.stringify(config, null, ' '))

Просмотреть файл

@ -4,7 +4,7 @@
*/
import * as dotenv from 'dotenv'
import * as convict from 'convict'
import { ICLOptions } from 'conversationlearner-sdk';
import { ICLOptions } from '@conversationlearner/sdk';
const result = dotenv.config()
if (result.error) {

Просмотреть файл

@ -6,7 +6,7 @@ import * as path from 'path'
import * as restify from 'restify'
import * as BB from 'botbuilder'
import { BotFrameworkAdapter, ConversationState } from 'botbuilder'
import { ConversationLearner, ClientMemoryManager, models, FileStorage } from 'conversationlearner-sdk'
import { ConversationLearner, ClientMemoryManager, models, FileStorage } from '@conversationlearner/sdk'
import config from '../config'
//===================

Просмотреть файл

@ -6,7 +6,7 @@ import * as path from 'path'
import * as restify from 'restify'
import * as BB from 'botbuilder'
import { BotFrameworkAdapter } from 'botbuilder'
import { ConversationLearner, ClientMemoryManager, models, FileStorage } from 'conversationlearner-sdk'
import { ConversationLearner, ClientMemoryManager, models, FileStorage } from '@conversationlearner/sdk'
import config from '../config'
//===================

Просмотреть файл

@ -6,7 +6,7 @@ import * as path from 'path'
import * as restify from 'restify'
import * as BB from 'botbuilder'
import { BotFrameworkAdapter } from 'botbuilder'
import { ConversationLearner, ClientMemoryManager, models, FileStorage } from 'conversationlearner-sdk'
import { ConversationLearner, ClientMemoryManager, models, FileStorage } from '@conversationlearner/sdk'
import config from '../config'
//===================

Просмотреть файл

@ -6,7 +6,7 @@ import * as path from 'path'
import * as restify from 'restify'
import * as BB from 'botbuilder'
import { BotFrameworkAdapter } from 'botbuilder'
import { ConversationLearner, ClientMemoryManager, RedisStorage, models, FileStorage } from 'conversationlearner-sdk'
import { ConversationLearner, ClientMemoryManager, RedisStorage, models, FileStorage } from '@conversationlearner/sdk'
import config from '../config'
//===================

Просмотреть файл

@ -6,7 +6,7 @@ import * as path from 'path'
import * as restify from 'restify'
import * as BB from 'botbuilder'
import { BotFrameworkAdapter } from 'botbuilder'
import { ConversationLearner, ClientMemoryManager, models, FileStorage } from 'conversationlearner-sdk'
import { ConversationLearner, ClientMemoryManager, models, FileStorage } from '@conversationlearner/sdk'
import config from '../config'
//===================

Просмотреть файл

@ -6,7 +6,7 @@ import * as path from 'path'
import * as restify from 'restify'
import * as BB from 'botbuilder'
import { BotFrameworkAdapter } from 'botbuilder'
import { ConversationLearner, ClientMemoryManager, models, FileStorage } from 'conversationlearner-sdk'
import { ConversationLearner, ClientMemoryManager, models, FileStorage } from '@conversationlearner/sdk'
import config from '../config'
//===================

Просмотреть файл

@ -6,7 +6,7 @@ import * as path from 'path'
import * as restify from 'restify'
import * as BB from 'botbuilder'
import { BotFrameworkAdapter } from 'botbuilder'
import { ConversationLearner, ClientMemoryManager, models, FileStorage } from 'conversationlearner-sdk'
import { ConversationLearner, ClientMemoryManager, models, FileStorage } from '@conversationlearner/sdk'
import config from '../config'
//===================
@ -44,7 +44,7 @@ let cl = new ConversationLearner(clAppId);
//=========================================================
// Bots Buisness Logic
//=========================================================
let cities = ['new york', 'boston', 'new orleans'];
let cities = ['new york', 'boston', 'new orleans', 'chicago'];
let cityMap:{ [index:string] : string } = {};
cityMap['big apple'] = 'new york';
cityMap['windy city'] = 'chicago';

Просмотреть файл

@ -6,7 +6,7 @@ import * as path from 'path'
import * as restify from 'restify'
import * as BB from 'botbuilder'
import { BotFrameworkAdapter } from 'botbuilder'
import { ConversationLearner, ClientMemoryManager, models, FileStorage } from 'conversationlearner-sdk'
import { ConversationLearner, ClientMemoryManager, models, FileStorage } from '@conversationlearner/sdk'
import config from '../config'
//===================

Просмотреть файл

@ -4,6 +4,6 @@
*/
import * as dotenv from 'dotenv'
import config from './config'
import { startUiServer } from 'conversationlearner-sdk'
import { startUiServer } from '@conversationlearner/sdk'
startUiServer(config.CONVERSATION_LEARNER_UI_PORT)

24
tslint.json Normal file
Просмотреть файл

@ -0,0 +1,24 @@
{
"defaultSeverity": "error",
"extends": [
],
"jsRules": {},
"rules": {
"no-banned-terms": true,
"no-delete-expression": true,
"no-document-domain": true,
"no-disable-auto-sanitization": true,
"no-duplicate-parameter-names": true,
"no-exec-script": true,
"no-function-constructor-with-string-args": true,
"no-octal-literal": true,
"no-reserved-keywords": true,
"no-string-based-set-immediate": true,
"no-string-based-set-interval": true,
"no-string-based-set-timeout": true,
"no-eval": true
},
"rulesDirectory": [
"node_modules/tslint-microsoft-contrib"
]
}

Двоичные данные
tutorial1_actions.PNG

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 8.4 KiB

Двоичные данные
tutorial1_dialogs.PNG

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 15 KiB