You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| Rule Name | Set alarm |A name describing the purpose of the rule |
56
+
| Actions | Send speech response - Ok, alarm set for {DateTime}" |The action to take when the rule condition is true
57
57
58
58
## Try it out
59
59
60
-
Select the Test panel and try a few interactions.
60
+
1.Select `Train` icon present on top of the right pane.
61
61
62
-
- Input: Set alarm for tomorrow at noon
63
-
- Output: "Ok, alarm set for 12/06/2019 12:00:00"
64
-
65
-
- Input: Set an alarm
66
-
- Output: "What time?"
67
-
- Input: 5pm
68
-
- Output: "Ok, alarm set for 12/05/2019 17:00:00"
62
+
1. Once training completes, select `Test`.
63
+
- Input: Set alarm for tomorrow at noon
64
+
- Output: Ok, alarm set for 2020-05-02 12:00:00
65
+
- Input: Set an alarm
66
+
- Output: What time?
67
+
- Input: 5pm
68
+
- Output: Ok, alarm set for 2020-05-01 17:00:00
69
69
70
70
## Add the advanced rules for confirmation
71
71
72
-
1. Add an advanced rule for confirmation.
72
+
Confirmations are achieved through addition of interactions rules.
73
+
74
+
1. In the existing `SetAlarm` command, add an **Interaction rule** by selection `+Add` icon in the middle pane and then selecting **Interaction rules** -> **Confirm command**.
73
75
74
76
This rule will ask the user to confirm the date and time of the alarm and is expecting a confirmation (yes/no) for the next turn.
| Rule Name | Denied confirm| A name describing the purpose of the rule |
97
-
| Conditions |DeniedConfirmation & Required Parameter - DateTime | Conditions that determine when the rule can run |
98
-
| Actions |ClearParameter - DateTime & SpeechResponse - "- No problem, what time then?" | The action to take when the rule condition is true |
101
+
| Rule Name | Denied confirmation| A name describing the purpose of the rule |
102
+
| Conditions |Confirmation was denied & Required Parameter -> DateTime | Conditions that determine when the rule can run |
103
+
| Actions |Clear parameter value -> DateTime & Send speech response -> No problem, what time then? | The action to take when the rule condition is true |
99
104
| State after execution | Wait for input | State of the user after the turn |
100
-
| Expectations |ElicitParameters - DateTime | Expectation for the next turn |
105
+
| Expectations |Expecting parameters(s) input from the user -> DateTime| Expectation for the next turn |
101
106
102
-
## Try it out
107
+
## Try out the changes
103
108
104
-
Select the Test panel and try a few interactions.
109
+
Select `Train`, wait for training complete and select `Test`.
105
110
106
111
- Input: Set alarm for tomorrow at noon
107
-
- Output: "Are you sure you want to set an alarm for 12/07/2019 12:00:00?"
112
+
- Output: Are you sure you want to set an alarm for 2020-05-02 12:00:00?
108
113
- Input: No
109
-
- Output: "No problem, what time then?"
114
+
- Output: No problem, what time then?
110
115
- Input: 5pm
111
-
- Output: "Are you sure you want to set an alarm for 12/06/2019 17:00:00?"
116
+
- Output: "Are you sure you want to set an alarm for 2020-05-01 17:00:00?"
Copy file name to clipboardExpand all lines: articles/cognitive-services/Speech-Service/how-to-custom-speech-commands-one-step-correction.md
+23-25Lines changed: 23 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,54 +16,52 @@ ms.author: encorona
16
16
17
17
In this article, you'll learn how to add one-step confirmation to a command.
18
18
19
-
One-step correction is used to update a command that was just completed.
20
-
21
-
I.e. if you just set up an alarm, you can change your mind and update the time of the alarm.
19
+
One-step correction is used to update a command that was just completed. That is, if you just set up an alarm, you can change your mind and update the time of the alarm. An example of such case is as follows-
22
20
23
21
- Input: Set alarm for tomorrow at noon
24
-
- Output: "Ok, alarm set for 12/06/2019 12:00:00"
22
+
- Output: Ok, alarm set for 2020-05-02 12:00:00
25
23
- Input: No, tomorrow at 1pm
26
-
- Output: "Ok
24
+
- Output: Ok
27
25
28
-
Keep in mind that this implies that you as a developer have a mechanism to update the alarm in your backend application.
26
+
A real world scenario, which is generally accompanied by client executing an action as a result of command completion - this article assumes that you as a developer have a mechanism to update the alarm in your back-end application.
29
27
30
28
## Prerequisites
31
29
32
30
You must have completed the steps in the following articles:
31
+
> [!div class="checklist"]
32
+
33
+
> *[Quickstart: Create a Custom Command (Preview)](./quickstart-custom-speech-commands-create-new.md)
34
+
> *[Quickstart: Create a Custom Command with Parameters (Preview)](./quickstart-custom-speech-commands-create-parameters.md)
35
+
> *[How To: Add a confirmation to a Custom Command (Preview)](./how-to-custom-speech-commands-confirmations.md)
33
36
34
-
-[Quickstart: Create a Custom Command (Preview)](./quickstart-custom-speech-commands-create-new.md)
35
-
-[Quickstart: Create a Custom Command with Parameters (Preview)](./quickstart-custom-speech-commands-create-parameters.md)
36
-
-[How To: Add a confirmation to a Custom Command (Preview)](./how-to-custom-speech-commands-confirmations.md)
37
37
38
-
## Add the advanced rules for one-step correction
38
+
## Add interaction rules for one-step correction
39
39
40
-
To demonstrate one-step correction, let's extend the **SetAlarm** command created in the [Confirmations How To](./how-to-custom-speech-commands-confirmations.md).
41
-
42
-
1. Add an advanced rule to update the previous alarm.
40
+
To demonstrate one-step correction, let's extend the **SetAlarm** command created in [How To: Add a confirmation to a Custom Command (Preview)](./how-to-custom-speech-commands-confirmations.md).
41
+
1. Add an interaction rule to update the previously set alarm.
43
42
44
43
This rule will ask the user to confirm the date and time of the alarm and is expecting a confirmation (yes/no) for the next turn.
| Rule Name | Update previous alarm | A name describing the purpose of the rule |
49
-
| Conditions |UpdateLastCommand & Required Parameter - DateTime | Conditions that determine when the rule can run |
50
-
| Actions |SpeechResponse - "- Updating previous alarm to {DateTime}"| The action to take when the rule condition is true |
51
-
|State after execution | Complete command | State of the user after the turn |
48
+
| Conditions |Previous command needs to be updated & Required Parameter -> DateTime | Conditions that determine when the rule can run |
49
+
| Actions |Send speech response -> Simple editor -> Updating previous alarm to {DateTime} | The action to take when the rule conditions are true |
50
+
|Post-execution state | Command completed| State of the user after the turn |
52
51
53
-
1. Move the rule you just created to the top of advanced rules (scroll over the rule in the panel and click the UP arrow).
52
+
1. Move the rule you just created to the top of interaction rules (select the rule in the panel and click the UP arrow present under `...` icon on the top of the middle pane).
54
53
> [!div class="mx-imgBorder"]
55
54
> 
56
-
57
-
> [!NOTE]
58
-
> In a real application, in the Actions section of this rule you'll also send back an activity to the client or call an HTTP endpoint to update the alarm in your system.
55
+
> [!NOTE]
56
+
> In a real application, in the Actions section of this rule you'll also send back an activity to the client or call an HTTP endpoint to update the alarm in your system.
59
57
60
58
## Try it out
61
59
62
-
Select the Test panel and try a few interactions.
60
+
Select `Train`, wait for training complete, and select `Test`.
63
61
64
62
- Input: Set alarm for tomorrow at noon
65
-
- Output: "Are you sure you want to set an alarm for 12/07/2019 12:00:00?"
63
+
- Output: Are you sure you want to set an alarm for 2020-05-02 12:00:00
66
64
- Input: Yes
67
-
- Output: "Ok, alarm set for 12/07/2019 12:00:00"
68
-
- Input: No, tomorrow at 1pm
69
-
- Output: "Updating previous alarm to 12/07/2019 13:00:00"
65
+
- Output: Ok, alarm set for 2020-05-02 12:00:00
66
+
- Input: No, tomorrow at 2pm
67
+
- Output: Updating previous alarm to 2020-05-02 14:00:00
0 commit comments