Siri Intent Handler Not Speaking Disambiguation Introduction

21 views Asked by At

I have a custom intent with multiple parameters. Two of the parameters are set up to handle disambiguation dialog. The intent definition file for each of these parameters is almost identical except for the parameter names and the wording in the siri dialog. Similarly, the code in the intent handler to resolve these parameters is nearly identical. But when disambiguation is invoked, the Disambiguation Introduction is only spoken by siri for one of the two parameters. What triggers the Disambiguation Introduction to be spoken in one and not the other? Here is the intentHandler code to resolve the first parameter (in which siri will speak the Disambiguation Introduction:

- (void)resolvePartsListNameForAddPart:(AddPartIntent *)intent withCompletion:(void (^)(INStringResolutionResult *resolutionResult))completion NS_SWIFT_NAME(resolvePartsListName(for:with:)) API_AVAILABLE(ios(13.0), macos(10.16), watchos(6.0)) {

...

NSMutableArray *options;
options = [[NSMutableArray alloc] init];
NSString *anOption = [NSString stringWithFormat:@"Use '%@' ", intent.partsListName]; // option 1
[options addObject:anOption];

anOption = [NSString stringWithFormat:@"test1"]; // option 2
[options addObject:anOption];

...

anOption = [NSString stringWithFormat:@"test5"]; // option 6        
[options addObject:anOption];

completion([INStringResolutionResult disambiguationWithStringsToDisambiguate:[options copy]]);
return;

...

}

Here is the intentHandler code to resolve the second parameter (in which siri DOES NOT speak the Disambiguation Introduction:

- (void)resolveChangeForAddPart:(AddPartIntent *)intent withCompletion:(void (^)(INStringResolutionResult *resolutionResult))completion NS_SWIFT_NAME(resolveChange(for:with:)) API_AVAILABLE(ios(13.0), macos(10.16), watchos(6.0)) {

...

NSMutableArray *options;
options = [[NSMutableArray alloc] init];
NSString *anOption = [NSString stringWithFormat:WOOD_TYPE_PARM]; // option 1
[options addObject:anOption];

// Option 2
anOption = [NSString stringWithFormat:PART_NAME_PARM];
[options addObject:anOption];

// Option 3
anOption = [NSString stringWithFormat:QUANTITY_PARM];
[options addObject:anOption];

// Option 4
anOption = [NSString stringWithFormat:DIMENSION_PARM];
[options addObject:anOption];

// Option 5
anOption = [NSString stringWithFormat:CANCEL_PARM];
[options addObject:anOption];


completion([INStringResolutionResult disambiguationWithStringsToDisambiguate:[options copy]]);
return;

}

Here is the Intents definition for the working parameter where Siri speaks the Disambiguation Introduction:

enter image description here

Here is the Intents definition for the non-working parameter

enter image description here

Again, what triggers the Disambiguation Introduction to be spoken in one and not the other? FYI: it does not make any difference whether or not the Disambiguation Introduction has the parameters 'count' and 'change' (i.e. if I make the introduction be Hello World, it still doesn't get spoken).

0

There are 0 answers