question

newuser-0749c7d1-81f7-4c36-b582-4401fc9611df avatar image
newuser-0749c7d1-81f7-4c36-b582-4401fc9611df asked ·

Invalid Built-In Intent?

Every attempt to add a built-in intent fails and throws the error

"There was a problem with your request: Invalid intent name 'AMAZON.SearchAction<object@WeatherForecast>'"

Is there any way to get around this?

The intent doc looks like this:

{

"intents": [

{

"intent": "AMAZON.SearchAction<object@WeatherForecast>"

}

]

}

alexa skills kitintentsbuilt-in libraryecho look
10 |2000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Brian@Amazon avatar image
Brian@Amazon answered ·

Looking into this.

10 |2000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

newuser-0749c7d1-81f7-4c36-b582-4401fc9611df avatar image
newuser-0749c7d1-81f7-4c36-b582-4401fc9611df answered ·

So now the intent JSON doc isn't the problem. The Lambda JSON response returns the variables as strings and not their stored values. And when the "name" key, in the last segment of "weather_attr", is replaced with "value", an error is thrown. Only the key "name" provides a value, and the value for the key "value" is never provided.For example:

def weather_call(intent, session):
   
    weather_attr = intent["slots"]["object.weatherCondition.name"]["name"]
    card_title = intent["name"]
    session_attributes = create_weather_attributes(card_title)
    should_end_session = False
    speech_output = "The weather forecast is as followed " + weather_attr + ""
    reprompt_text = ""
    return build_response(session_attributes, build_speechlet_response(card_title, speech_output, reprompt_text, should_end_session))

The above intent handler sends the following Lambda JSON request, when asked, "What's the

weather in New York City today":

{
  "session": {
    "sessionId": "SessionId.bc0a38ab-97b6-4860-b363-616e68afc92e",
    "application": {
      "applicationId": "amzn1.ask.skill.de27f1c2-6a3c-4c39-86ae-78749a66981e"
    },
    "attributes": {
      "weatherAttr": "AMAZON.SearchAction<object@WeatherForecast>"
    },
    "user": {
      "userId": "amzn1.ask.account.AEHD5LRUH4HTWKMKYXQPIF4HMASDFO7JBDVSDL3IRDWSATXTREM2EFOS4GFNPT3TSDOX2IETIJ7ED7KUZVB3RGAPGFG3K5P4XW76FWHOBKSDF2LXVE6UKLR6ORFPTOXWDGLVO52GJ3VKIVKIHO5VQHIPOR4VPFFBPJORXKQK5UETU2HTJLPZTZZIHCM4DPB6UYGNBECQ2QSKOCI"
    },
    "new": false
  },
  "request": {
    "type": "IntentRequest",
    "requestId": "EdwRequestId.ee76acff-6c4f-4427-807c-428796efd35a",
    "locale": "en-US",
    "timestamp": "2017-08-03T20:22:02Z",
    "intent": {
      "name": "AMAZON.SearchAction<object@WeatherForecast>",
      "slots": {
        "object.startTime": {
          "name": "object.startTime"
        },
        "object.type": {
          "name": "object.type",
          "value": "weather"
        },
        "object.location.addressLocality.name": {
          "name": "object.location.addressLocality.name",
          "value": "New York city"
        },
        "object.startDate": {
          "name": "object.startDate",
          "value": "2017-08-03"
        },
        "object.weatherCondition.name": {
          "name": "object.weatherCondition.name"
        },
        "object.duration": {
          "name": "object.duration"
        },
        "object.location.addressRegion.name": {
          "name": "object.location.addressRegion.name"
        },
        "object.location.addressCountry.name": {
          "name": "object.location.addressCountry.name"
        }
      }
    }
  },
  "version": "1.0"
}

And the Lambda JSON response that is returned is as follows:

{
  "version": "1.0",
  "response": {
    "outputSpeech": {
      "type": "PlainText",
      "text": "The weather forecast is as followed object.weatherCondition.name"
    },
    "card": {
      "content": "The weather forecast is as followed object.weatherCondition.name",
      "title": "AMAZON.SearchAction<object@WeatherForecast>",
      "type": "Simple"
    },
    "reprompt": {
      "outputSpeech": {
        "type": "PlainText",
        "text": ""
      }
    },
    "speechletResponse": {
      "outputSpeech": {
        "text": "The weather forecast is as followed object.weatherCondition.name"
      },
      "card": {
        "title": "AMAZON.SearchAction<object@WeatherForecast>",
        "content": "The weather forecast is as followed object.weatherCondition.name"
      },
      "reprompt": {
        "outputSpeech": {
          "text": ""
        }
      },
      "shouldEndSession": false
    }
  },
  "sessionAttributes": {
    "weatherAttr": "AMAZON.SearchAction<object@WeatherForecast>"
  }
}

Two questions:

How can I get the value of the slot without being thrown an error?

And how can the values of the intent/slots be returned as their stored values and not strings?

Thank you for your assistance

10 |2000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.