JulienCoo
JulienCoo

Reputation: 1198

Alexa - catchall

I've got a chatbot which is plugged to backend and DialogFlow/ApiAI. I'm trying to set up a skill in Alexa so that I can catch everything that is said to my skill and then forward it to my backend so that i can use my existing infrastructure and convo design.

I've been struggling with Alexa to set up an intent that catch everything and just forward it. From what I understand, you are supposed to use AMAZON.SearchQuery, but I'm getting the following error when i try to set the intent up:

Build Failed Sample utterance "CATCH_ALL {any}" in intent "CATCH_ALL" must include a carrier phrase. Sample intent utterances with phrase types cannot consist of only slots. Error code: MissingCarrierPhraseWithPhraseSlot -

intent configuration

Does anyone know how to do so ? I tried to use AMAZON.Literal as well, but it seems to be deprecated and I cannot build the skill when i use it. I'm kinda stuck. It would be great if someone had a solution...

Thanks.

Upvotes: 9

Views: 2986

Answers (4)

Joby korah george
Joby korah george

Reputation: 165

You can replace the AMAZON.SearchQuery with AMAZON.Person. Usually AMAZON.SearchQuery require a phrase along with the slot.Using AMAZON.Person there is no need of phrase along with the slot. It would accept any values that you pass to the Intent.

               {
                "name": "CATCH_ALL",
                "slots": [
                    {
                        "name": "any",
                        "type": "AMAZON.Person"
                    }
                ],
                "samples": [
                    "{any}"                      
                ]
            }

Upvotes: 7

Hareesh M U
Hareesh M U

Reputation: 1

You can create a custom slot with some random words.

{
    "interactionModel": {
        "languageModel": {
            "invocationName": "demo",
            "intents": [
                {
                    "name": "AMAZON.CancelIntent",
                    "samples": []
                },
                {
                    "name": "AMAZON.HelpIntent",
                    "samples": []
                },
                {
                    "name": "AMAZON.StopIntent",
                    "samples": []
                },
                {
                    "name": "EveryThingIntent",
                    "slots": [
                        {
                            "name": "EveryThingSlot",
                            "type": "BAG_OF_WORDS"
                        }
                    ],
                    "samples": [
                        "{EveryThingSlot} "
                    ]
                }
            ],
            "types": [
                {
                    "name": "BAG_OF_WORDS",
                    "values": [
                        {
                            "name": {
                                "value": "Hello World"
                            }
                        }
                    ]
                }
            ]
        }
    }
}

Upvotes: 0

JulienCoo
JulienCoo

Reputation: 1198

I finally managed to do so by doing something like this:

    {
        "interactionModel": {
            "languageModel": {
                "invocationName": "test",
               "intents": [
                {
                "name": "AMAZON.CancelIntent",
                    "samples": []
                },
                {
                    "name": "AMAZON.HelpIntent",
                    "samples": []
                },
                {
                    "name": "AMAZON.StopIntent",
                    "samples": []
                },
                {
                    "name": "CATCHALL",
                    "slots": [
                        {
                            "name": "any",
                            "type": "AMAZON.LITERAL"
                        }
                    ],
                        "samples": [
                            "{hey|any}",
                            "{hey hey|any}",
                           "{hey hey hey|any}",
                            "{hey hey hey hey|any}",
                            "{hey hey hey hey hey|any}"
                        ]
                    }
                ],
                "types": []
            }
        }
    }

the samples for the intent CATCHALL indicates the number of word you want to catch. So lige this, i will catch any sentence between one and this 5 words.

I'm not sure if this is going to be a problem when I'll submit the app, though.

Note that AMAZON.LITERAL is not supported for any language other than English (US), so this is not a solution for me as it's a french and english chatbot. So i'm back again at the beginning...

edit: Here is the solution without LITERAL:

{ "interactionModel": { "languageModel": { "invocationName": "mon invocation", "intents": [ { "name": "AMAZON.CancelIntent", "samples": [] }, { "name": "AMAZON.HelpIntent", "samples": [ "que puis-je faire" ] }, { "name": "AMAZON.StopIntent", "samples": [ "je veux quitter" ] }, { "name": "CATCH_ALL", "slots": [ { "name": "any", "type": "ANYTHING" } ], "samples": [ "{any}" ] } ], "types": [ { "name": "ANYTHING", "values": [ { "name": { "value": "hey" } }, { "name": { "value": "hey hey" } }, { "name": { "value": "hey hey hey" } }, { "name": { "value": "hey hey hey hey" } }, { "name": { "value": "hey hey hey hey hey" } }, { "name": { "value": "hey hey hey hey hey hey" } }, { "name": { "value": "hey hey hey hey hey hey hey" } }, { "name": { "value": "hey hey hey hey hey hey hey hey" } }, { "name": { "value": "hey hey hey hey hey hey hey hey hey" } }, { "name": { "value": "hey hey hey hey hey hey hey hey hey hey" } }, { "name": { "value": "hey hey hey hey hey hey hey hey hey hey hey" } }, { "name": { "value": "hey hey hey hey hey hey hey hey hey hey hey hey" } } ] } ] } } }

Upvotes: 6

Prisoner
Prisoner

Reputation: 50701

Unfortunately, there is no solution at this time. Alexa doesn't support a way to get all the text the way you're looking to do.

Upvotes: 3

Related Questions