Dmitry Klochkov
Dmitry Klochkov

Reputation: 2635

How to define a synonym for a Siri intent param keyword?

I am developing a Siri extension handler for INTransferMoneyIntent. In this intent there is a param toAccount which Siri can parse out from your request and pass to your handler. It can successfully parse out any values for the toAccount param even if they are not registered in the app(through the global AppIntentVocabulary.plist or through INVocabulary). But it can only recognise the account name from the request if the request contains the word 'account' before or after the actual account name. Say: 'transfer $3 to Beer account'. Or 'Transfer $10 to account Beer' where 'Beer' is account name. And this is totally fine as this is exactly what this intent is supposed to be used for. But my customer wants that instead of the word 'account' the app could be able to recognise the account name by the keyword 'category'. Like in the phrase 'Spent $30 on Beer category'. Or even simply 'Spent $30 on Beer'.

I know that I could add custom vocabulary through AppIntentVocabulary.plist or through the INVocabulary class. But it seems to allow only setting the possible values for the intent attributes(in my case for the attribute INTransferMoneyIntent.toAccount.organizationName of INTransferMoneyIntent.toAccount.nickname) but not to provide a synonyms for the keyword itself that is used to recognise a param from the request phrase.

I am 99% sure that it is not possible to achieve that, but who knows.. Maybe there are some hidden options I have not discovered yet..

Any suggestions?

Upvotes: 4

Views: 289

Answers (1)

Luca Angeletti
Luca Angeletti

Reputation: 59526

I confirm this is NOT possible.

Unfortunately you cannot use the AppIntentVocabulary.plist to define synonyms for the keywords that define the intent.

At least today with iOS 11.2

Upvotes: 3

Related Questions