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
Copy file name to clipboardExpand all lines: articles/cognitive-services/LUIS/luis-nodejs-tutorial-bf-v4.md
+180-2Lines changed: 180 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -105,11 +105,189 @@ In order to develop the web app bot code, download the code and use on your loca
105
105
106
106
1. Open the **dialogs -> luiHelper.js** file. This is where the user utterance entered into the bot is sent to LUIS. The response from LUIS is returned from the method as a **bookDetails** JSON object. When you create your own bot, you should also create your own object to return the details from LUIS.
107
107
108
-
[!code-javascript[This is where the user utterance entered into the bot is sent to LUIS.](~/samples-luis/documentation-samples/tutorial-web-app-bot/v4/luis-nodejs-bot-johnsmith-src/dialogs/luisHelper.js)]
108
+
```nodejs
109
+
// Copyright (c) Microsoft Corporation. All rights reserved.
if (!datetimeEntity || !datetimeEntity[0]) return undefined;
166
+
167
+
const timex = datetimeEntity[0]['timex'];
168
+
if (!timex || !timex[0]) return undefined;
169
+
170
+
const datetime = timex[0].split('T')[0];
171
+
return datetime;
172
+
}
173
+
}
174
+
175
+
module.exports.LuisHelper = LuisHelper;
176
+
```
109
177
110
178
1. Open **dialogs -> bookingDialog.js** to understand how the BookingDetails object is used to manage the conversation flow. Travel details are asked in steps, then the entire booking is confirmed and finally repeated back to the user.
111
179
112
-
[!code-javascript[Understand how the BookingDetails object is used to manage the conversation flow.](~/samples-luis/documentation-samples/tutorial-web-app-bot/v4/luis-nodejs-bot-johnsmith-src/dialogs/bookingDialog.js)]
180
+
```nodejs
181
+
// Copyright (c) Microsoft Corporation. All rights reserved.
const msg = `Please confirm, I have you traveling to: ${ bookingDetails.destination } from: ${ bookingDetails.origin } on: ${ bookingDetails.travelDate }.`;
0 commit comments