@@ -10,6 +10,9 @@ import prompts.*
10
10
import displays.*
11
11
import slotTypes.*
12
12
13
+ /************************
14
+ * CREATE CATALOG ITEM
15
+ ************************/
13
16
multiModalWelcome = MultiModalResponse {
14
17
apl = WelcomeAPL,
15
18
apla = AlexaConversationsWelcome
@@ -29,10 +32,6 @@ import slotTypes.*
29
32
}
30
33
)
31
34
32
- /************************
33
- * CREATE CATALOG ITEM
34
- ************************/
35
-
36
35
type BookItem {
37
36
String title
38
37
String genre
@@ -161,9 +160,17 @@ selectByIndexEvent = utterances<IndexSlotWrapper>([
161
160
"{index}"
162
161
])
163
162
164
- action RecommendationResult<SearchConditions, BookItem> getPage(SearchConditions searchConditions, Optional<String> pageToken, optional CatalogReference catalogRef)
165
- action RecommendationResult<SearchConditions, BookItem> selectItemApi(SearchConditions searchConditions, Page<BookItem> page, Number index, optional CatalogReference catalogRef)
163
+ selectByNameEvent = utterances<ItemNameSlotWrapper<TITLE>>([
164
+ "{name}",
165
+ "{name} would be good",
166
+ "I like {name}",
167
+ "{name} sounds interesting",
168
+ "show me {name}"
169
+ ])
166
170
171
+ action RecommendationResult<SearchConditions, BookItem> getPage(SearchConditions searchConditions, Optional<String> pageToken, optional CatalogReference catalogRef)
172
+ action RecommendationResult<SearchConditions, BookItem> selectItemApi(Page<BookItem> page, Number index, optional SearchConditions searchConditions, optional CatalogReference catalogRef)
173
+ action NUMBER indexOfItemByNameApi(Page<BookItem> page, TITLE name)
167
174
168
175
/************************
169
176
* OFFERS
@@ -241,25 +248,25 @@ action CatalogActionResult performAction_SendToPhone(List<BookItem> items, optio
241
248
* Anonymous Dialogs
242
249
************************/
243
250
244
- dialog RecommendationResult<SearchConditions, BookItem> allSearchPathsAdaptor(PropertyConfig<SearchConditions, BookItem> config, optional CatalogReference catalogRef) {
251
+ dialog RecommendationResult<SearchConditions, BookItem> allSearchPathsAdaptor(PropertyConfig<SearchConditions, BookItem, TITLE > config, optional CatalogReference catalogRef) {
245
252
sample {
246
253
allSearchPaths_2(config)
247
254
}
248
255
}
249
256
250
- dialog RecommendationResult<SearchConditions, BookItem> baseSearchPathsAdaptor(PropertyConfig<SearchConditions, BookItem> config, optional CatalogReference catalogRef) {
257
+ dialog RecommendationResult<SearchConditions, BookItem> baseSearchPathsAdaptor(PropertyConfig<SearchConditions, BookItem, TITLE > config, optional CatalogReference catalogRef) {
251
258
sample {
252
259
baseSearchPaths_2(config)
253
260
}
254
261
}
255
262
256
- dialog RecommendationResult<SearchConditions, BookItem> allFollowUpPathsAdaptor(PropertyConfig<SearchConditions, BookItem> config, RecommendationResult<SearchConditions, BookItem> priorResult, optional CatalogReference catalogRef) {
263
+ dialog RecommendationResult<SearchConditions, BookItem> allFollowUpPathsAdaptor(PropertyConfig<SearchConditions, BookItem, TITLE > config, RecommendationResult<SearchConditions, BookItem> priorResult, optional CatalogReference catalogRef) {
257
264
sample {
258
265
allFollowUpPaths_5(config, priorResult, catalogRef)
259
266
}
260
267
}
261
268
262
- dialog CatalogActionResult allCatalogActionPathsAdaptor(PropertyConfig<SearchConditions, BookItem> config, List<BookItem> items, optional CatalogReference catalogRef) {
269
+ dialog CatalogActionResult allCatalogActionPathsAdaptor(PropertyConfig<SearchConditions, BookItem, TITLE > config, List<BookItem> items, optional CatalogReference catalogRef) {
263
270
sample {
264
271
allCatalogActionPaths_3(config, items, catalogRef)
265
272
}
@@ -305,14 +312,16 @@ dialog MainDialog{
305
312
]
306
313
307
314
//Buidling the navigation configuration
308
- navigationConfig = buildNavigationConfig<SearchConditions, BookItem>(
315
+ navigationConfig = buildNavigationConfig<SearchConditions, BookItem, TITLE >(
309
316
nextEvent = nextEvent,
310
317
prevEvent = prevEvent,
311
318
getPageApi = getPage,
312
319
selectByOrdinalEvent = selectByOrdinalEvent,
313
320
selectByRelativePositionEvent = selectByRelativePositionEvent,
321
+ selectByNameEvent = selectByNameEvent,
314
322
selectByIndexEvent = selectByIndexEvent,
315
- selectItemApi = selectItemApi
323
+ indexOfItemByNameApi = indexOfItemByNameApi,
324
+ selectItemApi = selectItemApi,
316
325
)
317
326
318
327
//Buidling the Offers configuration
@@ -375,7 +384,7 @@ dialog MainDialog{
375
384
]
376
385
377
386
//Building the main catalog explorer configuration object
378
- config = buildCatalogConfig<SearchConditions, BookItem>(
387
+ config = buildCatalogConfig<SearchConditions, BookItem, TITLE >(
379
388
searchPatterns,
380
389
navigationConfig,
381
390
catalogProperties,
@@ -388,7 +397,7 @@ dialog MainDialog{
388
397
)
389
398
390
399
//calling the the catalog explorer component with the configuration object
391
- result = exploreCatalog<SearchConditions, BookItem>(config)
400
+ result = exploreCatalog<SearchConditions, BookItem, TITLE >(config)
392
401
393
402
//Below part is just for a workaround that the main deployable dialog cannont
394
403
//return CatalogExplorationResult which is the return type of the component
0 commit comments