k4l1sh / alexa-gpt

A tutorial on how to use ChatGPT in Alexa
MIT License
177 stars 38 forks source link

Error when building #1

Closed guilhermersantana closed 1 year ago

guilhermersantana commented 1 year ago

Sample utterance " {query}" in intent "GptQueryIntent" must include a carrier phrase. Sample intent utterances with phrase types cannot consist of only slots.

enloejustin commented 1 year ago

I'm having the same issue, and it's my first time with Alexa Developer Console. I found some knowledge base articles here that I'm currently reading: https://developer.amazon.com/en-IN/blogs/alexa/alexa-skills-kit/2020/01/improving-nlu-accuracy-of-alexa-skills https://developer.amazon.com/en-US/docs/alexa/custom-skills/best-practices-for-sample-utterances-and-custom-slot-type-values.html

guilhermersantana commented 1 year ago

image

I noticed that you can't just pass the 'variable' to the intention, so I put some auxiliary words that made sense in the question, like "ask {query}", "search {query}", "tell me {query}" and it worked.

k4l1sh commented 1 year ago

This happens because when the type is AMAZON.SearchQuery the skill requires an activation word. The downside of this is that you always have to speak this activation word to continue dialoguing with ChatGPT. I wanted a solution where it was not necessary to repeat the same word. I solved it by adding a space before the {query} getting " {query}". This was working when I wrote this tutorial, but apparently they put an error when you do it now.

I found a solution for this at https://stackoverflow.com/questions/49948118/alexa-catchall

All that needs to be done is to change the type of AMAZON.SearchQuery to AMAZON.Person in the json editor, the GptQueryIntent will look like this:

{
    "name": "GptQueryIntent",
    "slots": [
        {
            "name": "query",
            "type": "AMAZON.Person"
        }
    ],
    "samples": [
        "{query}"
    ]
}

I fixed this in the tutorial.