Skip to content

Commit

Permalink
Added readme to roller skill sample
Browse files Browse the repository at this point in the history
  • Loading branch information
Stevenic committed Apr 17, 2017
1 parent 10544d1 commit 0bf8b77
Show file tree
Hide file tree
Showing 4 changed files with 183 additions and 6 deletions.
4 changes: 4 additions & 0 deletions Node/demo-RollerSkill/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Bot Framework Credentials

MICROSOFT_APP_ID=
MICROSOFT_APP_PASSWORD=
32 changes: 32 additions & 0 deletions Node/demo-RollerSkill/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Roller Sample Skill

A simple dice rolling skill/bot that's been optimized for speech enabled channels.

[![Deploy to Azure][Deploy Button]][Deploy Node/RollerSkill]

[Deploy Button]: https://azuredeploy.net/deploybutton.png
[Deploy Node/SendRollerSkill]: https://azuredeploy.net

### Prerequisites

The minimum prerequisites to run this sample are:
* Latest Node.js with NPM. Download it from [here](https://nodejs.org/en/download/).
* The Bot Framework Emulator. To install the Bot Framework Emulator, download it from [here](https://emulator.botframework.com/). Please refer to [this documentation article](https://github.com/microsoft/botframework-emulator/wiki/Getting-Started) to know more about the Bot Framework Emulator.
* **[Recommended]** Visual Studio Code for IntelliSense and debugging, download it from [here](https://code.visualstudio.com/) for free.

### Code Highlights

The sample showcases the use of new features designed specifically for speech:

* **IMessage.speak**: Lets include Speech Synthesis Markup Language (SSML) in your bots responses to control what the bot says, in addition to what it shows. A small [utility module](ssml.js) is included to simplify building up your bots SSML based responses.
* **IMessage.inputHint**: Used to provide a speech based client with hints as to how they should manage the microphone. A hint of `InputHints.ignoringInput` can be sent to tell the client that the bot will be sending more messages and should wait to open the mic. The `InputHints.acceptingInput` hint means that the bot is finished speaking and ready to receive additional requests from the user but the mic should be closed. And the `InputHints.expectingInput` hint indicates that the bot is expecting an answer to a prompt and the mic should be left open. In general, the SDK will send these hints for you automatically so you don't have to worry too much about them.
* **Session.say()**: A new method that can be called in place of `Session.send()` and includes additional parameters for sending SSML output, as well as attachments like cards.
* **IPromptOptions.speak & retrySpeak**: The built-in prompts have all been updated to support sending SSML as part of the prompts output.
* **Prompts.choice() synonyms**: The built-in choice() prompt has been updated to support passing in synonyms which allows for more flexibility recognition wise.
* **Other Prompt Improvements**: A number of other improvements have been made to the built-in prompts to add with building bots that work better with speech recognition.

### More Information

To get more information about how to get started in Bot Builder for Node and Attachments please review the following resources:
* [Bot Builder for Node.js Reference](https://docs.botframework.com/en-us/node/builder/overview/#navtitle)
* [SSML Language Reference](https://msdn.microsoft.com/en-us/library/hh378377(v=office.14).aspx)
129 changes: 129 additions & 0 deletions Node/demo-RollerSkill/azuredeploy.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
{
"$schema": "http://schema.management.azure.com/schemas/2014-04-01-preview/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"siteName": {
"defaultValue": "BotBuilder-Samples",
"type": "string"
},
"hostingPlanName": {
"type": "string"
},
"siteLocation": {
"type": "string"
},
"sku": {
"type": "string",
"allowedValues": [
"Free",
"Shared",
"Basic",
"Standard"
],
"defaultValue": "Free"
},
"workerSize": {
"type": "string",
"allowedValues": [
"0",
"1",
"2"
],
"defaultValue": "0"
},
"repoUrl": {
"type": "string"
},
"branch": {
"type": "string"
},
"Project": {
"type": "string",
"defaultValue": "Node/demo-RollerSkill"
},
"WEBSITE_NODE_DEFAULT_VERSION": {
"type": "string",
"defaultValue": "5.9.1"
},
"MICROSOFT_APP_ID": {
"type": "string"
},
"MICROSOFT_APP_PASSWORD": {
"type": "string"
}
},
"resources": [
{
"apiVersion": "2014-06-01",
"name": "[parameters('hostingPlanName')]",
"type": "Microsoft.Web/serverFarms",
"location": "[parameters('siteLocation')]",
"properties": {
"name": "[parameters('hostingPlanName')]",
"sku": "[parameters('sku')]",
"workerSize": "[parameters('workerSize')]",
"numberOfWorkers": 1
}
},
{
"apiVersion": "2014-06-01",
"name": "[parameters('siteName')]",
"type": "Microsoft.Web/Sites",
"location": "[parameters('siteLocation')]",
"dependsOn": [
"[concat('Microsoft.Web/serverFarms/', parameters('hostingPlanName'))]"
],
"tags": {
"[concat('hidden-related:', resourceGroup().id, '/providers/Microsoft.Web/serverfarms/', parameters('hostingPlanName'))]": "empty"
},
"properties": {
"name": "[parameters('siteName')]",
"serverFarm": "[parameters('hostingPlanName')]"
},
"resources": [
{
"apiVersion": "2014-04-01",
"type": "config",
"name": "web",
"dependsOn": [
"[concat('Microsoft.Web/Sites/', parameters('siteName'))]"
],
"properties": {
"appSettings": [
{
"name": "Project",
"value": "[parameters('Project')]"
},
{
"name": "WEBSITE_NODE_DEFAULT_VERSION",
"value": "[parameters('WEBSITE_NODE_DEFAULT_VERSION')]"
},
{
"name": "MICROSOFT_APP_ID",
"value": "[parameters('MICROSOFT_APP_ID')]"
},
{
"name": "MICROSOFT_APP_PASSWORD",
"value": "[parameters('MICROSOFT_APP_PASSWORD')]"
}
]
}
},
{
"apiVersion": "2014-04-01",
"name": "web",
"type": "sourcecontrols",
"dependsOn": [
"[resourceId('Microsoft.Web/Sites', parameters('siteName'))]",
"[concat('Microsoft.Web/Sites/', parameters('siteName'), '/config/web')]"
],
"properties": {
"RepoUrl": "[parameters('repoUrl')]",
"branch": "[parameters('branch')]",
"IsManualIntegration": true
}
}
]
}
]
}
24 changes: 18 additions & 6 deletions Node/demo-RollerSkill/package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,25 @@
{
"name": "rollerskill",
"name": "botbuilder-sample-rollerskill",
"version": "1.0.0",
"description": "Sample BotBuilder skill for speech enabled Bot Framework channels.",
"main": "app.js",
"description": "Bot Builder Sample - Roller Skill",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"start": "node app.js"
},
"author": "Microsoft Corp.",
"license": "MIT",
"keywords": [
"botbuilder",
"bots",
"chatbots",
"botbuilder-samples"
],
"bugs": {
"url": "https://github.com/Microsoft/BotBuilder-Samples/issues"
},
"repository": {
"type": "git",
"url": "https://github.com/Microsoft/BotBuilder-Samples.git"
},
"author": "",
"license": "ISC",
"dependencies": {
"botbuilder": "^3.8.0-beta2",
"restify": "^4.3.0"
Expand Down

0 comments on commit 0bf8b77

Please sign in to comment.