Skip to content

Commit 9fb29e1

Browse files
authored
fix for bug 1575903
Removed reference(s) to retry prompts; Cortana does not support them.
1 parent bb49a62 commit 9fb29e1

File tree

1 file changed

+18
-11
lines changed

1 file changed

+18
-11
lines changed

articles/nodejs/bot-builder-nodejs-cortana-skill.md

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ manager: kamrani
66
ms.topic: article
77
ms.service: bot-service
88
ms.subservice: sdk
9-
ms.date: 12/13/2017
9+
ms.date: 02/10/2019
1010
monikerRange: 'azure-bot-service-3.0'
1111
---
1212
# Build a speech-enabled bot with Cortana skills
@@ -53,42 +53,46 @@ The **inputHint** property helps indicate to Cortana whether your bot is expecti
5353
|------|------|
5454
| **acceptingInput** | Your bot is passively ready for input but is not waiting on a response. Cortana accepts input from the user if the user holds down the microphone button.|
5555
| **expectingInput** | Indicates that the bot is actively expecting a response from the user. Cortana listens for the user to speak into the microphone. |
56-
| **ignoringInput** | Cortana is ignoring input. Your bot may send this hint if it is actively processing a request and will ignore input from users until the request is complete. |
57-
56+
||NOTE: Do _not_ use **expectingInput** on headless devices (devices without a display). See the [Cortana Skills Kit FAQ](https://review.docs.microsoft.com/en-us/cortana/skills/faq).|
57+
| **ignoringInput** | Cortana is ignoring input. Your bot may send this hint if it is actively processing a request, and will ignore input from users until the request is complete. |
5858

5959
The following example shows how Cortana reads plain text or SSML:
6060

6161
```javascript
62+
6263
// Have Cortana read plain text
6364
session.say('This is the text that Cortana displays', 'This is the text that is spoken by Cortana.');
6465

6566
// Have Cortana read SSML
6667
session.say('This is the text that Cortana displays', '<speak version="1.0" xmlns="http://www.w3.org/2001/10/synthesis" xml:lang="en-US">This is the text that is spoken by Cortana.</speak>');
68+
6769
```
6870

6971
This example shows how to let Cortana know that user input is expected. The microphone will be left open.
72+
7073
```javascript
74+
7175
// Add an InputHint to let Cortana know to expect user input
7276
session.say('Hi there', 'Hi, what’s your name?', {
7377
inputHint: builder.InputHint.expectingInput
7478
});
79+
7580
```
7681
<!-- TODO: tip about time limit and batching -->
7782

78-
7983
### Prompts
8084

8185
In addition to using the **session.say()** method you can also pass text or SSML to built-in prompts using the **speak** and **retrySpeak** options.
8286

8387
```javascript
88+
8489
builder.Prompts.text(session, 'text based prompt', {
8590
speak: 'Cortana reads this out initially',
8691
retrySpeak: 'This message is repeated by Cortana after waiting a while for user input',
8792
inputHint: builder.InputHint.expectingInput
8893
});
89-
```
90-
9194

95+
```
9296

9397
<!-- TODO: Link to SSML library -->
9498

@@ -97,6 +101,7 @@ To present the user with a list of choices, use **Prompts.choice**. The **synony
97101
**Prompts.choice** supports ordinal choices. This means that the user can say "the first", "the second" or "the third" to choose an item in a list. For example, given the following prompt, if the user asked Cortana for "the second option", the prompt will return the value of 8.
98102

99103
```javascript
104+
100105
var choices = [
101106
{ value: '4', action: { title: '4 Sides' }, synonyms: 'four|for|4 sided|4 sides' },
102107
{ value: '8', action: { title: '8 Sides' }, synonyms: 'eight|ate|8 sided|8 sides' },
@@ -106,11 +111,13 @@ To present the user with a list of choices, use **Prompts.choice**. The **synony
106111
builder.Prompts.choice(session, 'choose_sides', choices, {
107112
speak: speak(session, 'choose_sides_ssml') // use helper function to format SSML
108113
});
114+
109115
```
110116

111117
In the previous example, the SSML for the prompt's **speak** property is formatted by using strings stored in a localized prompts file with the following format.
112118

113119
```json
120+
114121
{
115122
"choose_sides": "__Number of Sides__",
116123
"choose_sides_ssml": [
@@ -119,8 +126,8 @@ In the previous example, the SSML for the prompt's **speak** property is formatt
119126
"All the standard sizes are supported."
120127
]
121128
}
122-
```
123129

130+
```
124131

125132
A helper function then builds the required root element of a Speech Synthesis Markup Language (SSML) document.
126133

@@ -152,7 +159,7 @@ See [Card design best practices][CardDesign] to see what these cards look like i
152159

153160
The following code demonstrates how to add the **speak** and **inputHint** properties to a message containing a Hero card.
154161

155-
```javascript
162+
```javascript
156163

157164
bot.dialog('HelpDialog', function (session) {
158165
var card = new builder.HeroCard(session)
@@ -168,7 +175,6 @@ bot.dialog('HelpDialog', function (session) {
168175
session.send(msg).endDialog();
169176
}).triggerAction({ matches: /help/i });
170177

171-
172178
/** This helper function builds the required root element of a Speech Synthesis Markup Language (SSML) document. */
173179
module.exports.speak = function (template, params, options) {
174180
options = options || {};
@@ -191,6 +197,7 @@ You invoke the skill by saying its [invocation name][InvocationNameGuidelines] t
191197
The RollerSkill sample starts by opening a card with some buttons to tell the user which options are available to them.
192198

193199
```javascript
200+
194201
/**
195202
* Create your bot with a default message handler that receive messages from the user.
196203
* - This function is be called anytime the user's utterance isn't
@@ -230,8 +237,6 @@ something like "I'd like to roll some dice". It uses a regular expression to mat
230237

231238

232239
```javascript
233-
234-
235240
bot.dialog('CreateGameDialog', [
236241
function (session) {
237242
// Initialize game structure.
@@ -292,6 +297,7 @@ bot.dialog('CreateGameDialog', [
292297
/(roll|role|throw|shoot).*(dice|die|dye|bones)/i,
293298
/new game/i
294299
]});
300+
295301
```
296302

297303
### Render results
@@ -403,6 +409,7 @@ bot.dialog('PlayGameDialog', function (session, args) {
403409
session.replaceDialog('CreateGameDialog');
404410
}
405411
}).triggerAction({ matches: /(roll|role|throw|shoot) again/i });
412+
406413
```
407414

408415
## Next steps

0 commit comments

Comments
 (0)