RE: Type and Amazon Specific Intents


#1

Hello,

I am building a voice application that, in part, acts as a search function for a libraries media. For dialogflow, I am using the @sys.any type. There does not seem to be a perfect equivalent for Alexa. After trying a few things, I decided to make a few different intents with specific amazon slot types as a work around. The relevant portion of my language model is displayed below:

"alexa": {
		"interactionModel": {
			"languageModel": {
				"intents": [
					{
						"name": "BookSearchIntent",
						"phrases": [
							"I want {searchPhrase}", 
							"{searchPhrase}", 
							"I want to search for {searchPhrase}",
							"to search for {searchPhrase}",
							"I want to look for {searchPhrase}",
							"to look for {searchPhrase}",
							"I want to find {searchPhrase}", 
							"to find {searchPhrase}", 
							"I want to get {searchPhrase}",
							"to get {searchPhrase}", 
							"I am looking for {searchPhrase}", 
							"I am searching for {searchPhrase}", 
							"I want to find {searchPhrase}"
						],
						"inputs": [
							{
								"name": "searchPhrase",
								"type": {
									"alexa": "AMAZON.Book" 
								}
							}
						]
					},
					{
						"name": "BookSeriesSearchIntent",
						"phrases": [
							"I want {searchPhrase}", 
							"{searchPhrase}", 
							"I want to search for {searchPhrase}",
							"to search for {searchPhrase}",
							"I want to look for {searchPhrase}",
							"to look for {searchPhrase}",
							"I want to find {searchPhrase}", 
							"to find {searchPhrase}", 
							"I want to get {searchPhrase}",
							"to get {searchPhrase}", 
							"I am looking for {searchPhrase}", 
							"I am searching for {searchPhrase}", 
							"I want to find {searchPhrase}"
						],
						"inputs": [
							{
								"name": "searchPhrase",
								"type": {
									"alexa": "AMAZON.BookSeries" 
								}
							}
						]
					},
					{
						"name": "AuthorSearchIntent",
						"phrases": [
							"I want {searchPhrase}", 
							"{searchPhrase}", 
							"I want to search for {searchPhrase}",
							"to search for {searchPhrase}",
							"I want to look for {searchPhrase}",
							"to look for {searchPhrase}",
							"I want to find {searchPhrase}", 
							"to find {searchPhrase}", 
							"I want to get {searchPhrase}",
							"to get {searchPhrase}", 
							"I am looking for {searchPhrase}", 
							"I am searching for {searchPhrase}", 
							"I want to find {searchPhrase}"
						],
						"inputs": [
							{
								"name": "searchPhrase",
								"type": {
									"alexa": "AMAZON.Author" 
								}
							}
						]
					},
					{
						"name": "CharacterSearchIntent",
						"phrases": [
							"I want {searchPhrase}", 
							"{searchPhrase}", 
							"I want to search for {searchPhrase}",
							"to search for {searchPhrase}",
							"I want to look for {searchPhrase}",
							"to look for {searchPhrase}",
							"I want to find {searchPhrase}", 
							"to find {searchPhrase}", 
							"I want to get {searchPhrase}",
							"to get {searchPhrase}", 
							"I am looking for {searchPhrase}", 
							"I am searching for {searchPhrase}", 
							"I want to find {searchPhrase}"
						],
						"inputs": [
							{
								"name": "searchPhrase",
								"type": {
									"alexa": "AMAZON.FictionalCharacter" 
								}
							}
						]
					},
					{
						"name": "FilmSearchIntent",
						"phrases": [
							"I want {searchPhrase}", 
							"{searchPhrase}", 
							"I want to search for {searchPhrase}",
							"to search for {searchPhrase}",
							"I want to look for {searchPhrase}",
							"to look for {searchPhrase}",
							"I want to find {searchPhrase}", 
							"to find {searchPhrase}", 
							"I want to get {searchPhrase}",
							"to get {searchPhrase}", 
							"I am looking for {searchPhrase}", 
							"I am searching for {searchPhrase}", 
							"I want to find {searchPhrase}"
						],
						"inputs": [
							{
								"name": "searchPhrase",
								"type": {
									"alexa": "AMAZON.Movie" 
								}
							}
						]
					},
					{
						"name": "FilmSeriesSearchIntent",
						"phrases": [
							"I want {searchPhrase}", 
							"{searchPhrase}", 
							"I want to search for {searchPhrase}",
							"to search for {searchPhrase}",
							"I want to look for {searchPhrase}",
							"to look for {searchPhrase}",
							"I want to find {searchPhrase}", 
							"to find {searchPhrase}", 
							"I want to get {searchPhrase}",
							"to get {searchPhrase}", 
							"I am looking for {searchPhrase}", 
							"I am searching for {searchPhrase}", 
							"I want to find {searchPhrase}"
						],
						"inputs": [
							{
								"name": "searchPhrase",
								"type": {
									"alexa": "AMAZON.MovieSeries" 
								}
							}
						]
					},
					{
						"name": "DirectorSearchIntent",
						"phrases": [
							"I want {searchPhrase}", 
							"{searchPhrase}", 
							"I want to search for {searchPhrase}",
							"to search for {searchPhrase}",
							"I want to look for {searchPhrase}",
							"to look for {searchPhrase}",
							"I want to find {searchPhrase}", 
							"to find {searchPhrase}", 
							"I want to get {searchPhrase}",
							"to get {searchPhrase}", 
							"I am looking for {searchPhrase}", 
							"I am searching for {searchPhrase}", 
							"I want to find {searchPhrase}",
							"{searchPhrase}"
						],
						"inputs": [
							{
								"name": "searchPhrase",
								"type": {
									"alexa": "AMAZON.Director" 
								}
							}
						]
					},
					{
						"name": "ActorSearchIntent",
						"phrases": [
							"I want {searchPhrase}", 
							"{searchPhrase}", 
							"I want to search for {searchPhrase}",
							"to search for {searchPhrase}",
							"I want to look for {searchPhrase}",
							"to look for {searchPhrase}",
							"I want to find {searchPhrase}", 
							"to find {searchPhrase}", 
							"I want to get {searchPhrase}",
							"to get {searchPhrase}", 
							"I am looking for {searchPhrase}", 
							"I am searching for {searchPhrase}", 
							"I want to find {searchPhrase}",
							"{searchPhrase}"
						],
						"inputs": [
							{
								"name": "searchPhrase",
								"type": {
									"alexa": "AMAZON.Actor" 
								}
							}
						]
					},
					{
						"name": "VideoGameSearchIntent",
						"phrases": [
							"I want {searchPhrase}", 
							"{searchPhrase}", 
							"I want to search for {searchPhrase}",
							"to search for {searchPhrase}",
							"I want to look for {searchPhrase}",
							"to look for {searchPhrase}",
							"I want to find {searchPhrase}", 
							"to find {searchPhrase}", 
							"I want to get {searchPhrase}",
							"to get {searchPhrase}", 
							"I am looking for {searchPhrase}", 
							"I am searching for {searchPhrase}", 
							"I want to find {searchPhrase}",
							"{searchPhrase}"
						],
						"inputs": [
							{
								"name": "searchPhrase",
								"type": {
									"alexa": "AMAZON.VideoGame" 
								}
							}
						]
					},
					{
						"name": "TVSeriesSearchIntent",
						"phrases": [
							"I want {searchPhrase}", 
							"{searchPhrase}", 
							"I want to search for {searchPhrase}",
							"to search for {searchPhrase}",
							"I want to look for {searchPhrase}",
							"to look for {searchPhrase}",
							"I want to find {searchPhrase}", 
							"to find {searchPhrase}", 
							"I want to get {searchPhrase}",
							"to get {searchPhrase}", 
							"I am looking for {searchPhrase}", 
							"I am searching for {searchPhrase}", 
							"I want to find {searchPhrase}"
						],
						"inputs": [
							{
								"name": "searchPhrase",
								"type": {
									"alexa": "AMAZON.TVSeries" 
								}
							}
						]
					},
					{
						"name": "AMAZON.FallbackIntent",
						"samples": []
					},
					{
						"name": "AMAZON.CancelIntent",
						"samples": []
					},
					{
						"name": "AMAZON.HelpIntent",
						"samples": []
					},
					{
						"name": "AMAZON.StopIntent",
						"samples": []
					},
					{
						"name": "AMAZON.NavigateHomeIntent",
						"samples": []
					}
				]
			}
		}
	},

I haven’t changed sample dialogue, but I intend to. Here is the code in my src file.

DialogFlowSearchIntent() {
        return this.toStateIntent('MediaSearchState', 'GenericSearchIntentProcessor');
    },

    BookSearchIntent() {
        return this.toStateIntent('MediaSearchState', 'GenericSearchIntentProcessor');
    },

    BookSeriesSearchIntent() {
        return this.toStateIntent('MediaSearchState', 'GenericSearchIntentProcessor');
    },

    AuthorSearchIntent() {
        return this.toStateIntent('MediaSearchState', 'GenericSearchIntentProcessor');
    },

    CharacterSearchIntent() {
        return this.toStateIntent('MediaSearchState', 'GenericSearchIntentProcessor');
    },

    FilmSearchIntent() {
        return this.toStateIntent('MediaSearchState', 'GenericSearchIntentProcessor');
    },

    FilmSeriesSearchIntent() {
        return this.toStateIntent('MediaSearchState', 'GenericSearchIntentProcessor');
    },

    DirectorSearchIntent() {
        return this.toStateIntent('MediaSearchState', 'GenericSearchIntentProcessor');
    },

    ActorSearchIntent() {
        return this.toStateIntent('MediaSearchState', 'GenericSearchIntentProcessor');
    },

    VideoGameSearchIntent() {
        return this.toStateIntent('MediaSearchState', 'GenericSearchIntentProcessor');
    },

    TVSeriesSearchIntent() {
        return this.toStateIntent('MediaSearchState', 'GenericSearchIntentProcessor');
    },



    MediaSearchState:
    {
        async GenericSearchIntentProcessor() {
            let contentTitle = this.$inputs.searchPhrase.value;
            let data = await searchMedia(contentTitle);
            iter = new MediaIterator(data);

            if (iter.HasNext()) {
                iter.Next();
                let reprompt = "To navigate search results say, next, repeat, previous. To cancel say cancel.  ";
                let response = iter.FormatForSpeech();
                response = reprompt + response;
                this.ask(response, reprompt);
            }
            else {
                this.tell("Sadly, your search did not turn up any results.")
            }
        },

I understand that the, let contentTitle = this.$inputs.searchPhrase.value; line might not map to the correct “searchPhrase”, but the issue I am currently having is the Alexa intents are not being recognized at all. Am I just defining the Alexa intents incorrectly in the language model? I also have a dialogflow specific intent for searching, is it possible that there is interference?


#2

I think this might be difficult because you’re using the same utterances for different intents.

Does the Alexa Developer Console show anything in the utterance conflicts?


#3

Within one voice app I need intents used exclusively by dialogflow, others used exclusively by alexa, and some that are used for both platforms. This has to do with type. A lot of the search intents I have work really well with @sys.any— dialogflow’s literal entry type. I have to breakup the alexa intents into several with more specific slot types.

What I am doing now, the code above in the previous post, is not working. I have been getting [ERR] smapiUpdateInteractionModel:undefined when I try to deploy. How do I create intents that can ONLY be used by alexa and dialogflow respectively? Am I on the right track above?

Really appreciate the help!!!

Best.