微软 Bot Framework (https://dev.botframework.com/) 提供的工具可用于在一个位置构建、测试、部署和管理聊天机器人。 通过使用 SDK、工具、模板和 AI 服务提供的模块化可扩展框架,开发人员可以创建可使用语音、自然语言理解、问题和答案处理等功能的机器人。
Bot Emulator 是 Botframework 的机器人集成开发工具 IDE。利用 Bot Emulator 快速开发聊天机器人。
Bot Emulator 快速开始
setup project
npm install -g yo
npm install -g generator-botbuilder
yo botbuilder
create luis.ai service
-
Learn bot file
-
Learn bot adapter
-
Install azure cli
source ~/venv-py3/bin/activate
pip install --pre azure-cli --extra-index-url https://azurecliprod.blob.core.windows.net/edge
- Login Azure Cli
az login
- Install cli tools
npm i -g msbot luis-apis ludown
- Get Luis Authoring Key
Login : https://www.luis.ai/home
Navigate to : https://www.luis.ai/user/settings
- Get AZURE SUBSCRIPTION ID
- Parse LUIS.ai Model
cd $baseDir/../myJsBots
ludown parse toluis \
--in dialogs/greeting/resources/main.lu \
-o cognitiveModels/ \
--out basicBot.luis \
-n 'myJsBots_myChatBot-LUIS' \
-d 'Bot Builder V4 Basic Bot.' --verbose
- Deploy LUIS.ai Service
luis import application \
--in cognitiveModels/basicBot.luis \
--authoringKey $LUIS_KEY \
--msbot --endpointRegion | msbot --secret $MSBOT_SECRET connect luis --stdin
- Train LUIS.ai Service
msbot get myJsBots_myChatBot-LUIS --secret $MSBOT_SECRET | luis train version --wait --stdin
- Publish LUIS.ai Service
msbot get myJsBots_myChatBot-LUIS --secret $MSBOT_SECRET | luis publish version --wait --stdin
Start project
cd myJsBots
npm start
Connect with Botframework Emulator
references
Create a bot with the Bot Builder SDK for JavaScript
troubles
- [msbot] can not clone service #632
~/.nvm/versions/node/v8.10.0/lib/node_modules/msbot/bin/msbot-clone-services.js
- [azure-cli] does not work with bot service
Install edge build from https://github.com/Azure/azure-cli