WeatherForecast Intents


Introduction

A weather forecast. These intents let users ask for general weather forecasts, as well as more specific questions about specific weather conditions.

This document provides a quick reference to the WeatherForecast intents and corresponding slots. For details around how these intents are specified, see Understanding the Structure of the Built-in Intent Library.

Intent Signature

Use the intent signature as the intent name in your intent schema. This example shows a schema with two WeatherForecast intents:

{
    "intents": [
        {
            "name": "AMAZON.SearchAction<object@WeatherForecast[weatherCondition]>"
        }, 
        {
            "name": "AMAZON.SearchAction<object@WeatherForecast>"
        }
    ]
}

For more about the components of this signature, see Understanding the Structure of the Built-in Intent Library.

To see the full JSON format for intents, see Interaction Model Schema. You can also use the developer console user interface to add the intents and then see the JSON code in the JSON Editor.

WeatherForecast Intents

The following table summarizes the available WeatherForecast intents and the set of slots that may be included. For each intent, the sections below the table show:

  • A sample utterance that would invoke the intent.
  • The JSON you include in your intent schema if you want to use the intent.
  • An example of the IntentRequest sent to your skill for the provided sample utterance, illustrating the slots that may be included. For brevity, these samples leave out the full set of properties that are normally part of a complete IntentRequest.

    Note that if your interaction model includes multiple intents with similar utterances, your results may vary from these examples.

For definitions of the slots used in these intents, see WeatherForecast Slots.

Intent Signature Example Utterance Possible Slots
AMAZON.SearchAction<object@WeatherForecast> "tell me the forecast" object.location.addressLocality.name
object.location.addressCountry.name
object.weatherCondition.name
object.startDate
object.duration
object.location.addressRegion.name
object.startTime
object.type
AMAZON.SearchAction<object@WeatherForecast[temperature]> "what's the low temperature tonight" object.location.addressLocality.name
object.location.addressCountry.name
object.weatherCondition.name
object.startDate
object.duration
object.location.addressRegion.name
object.startTime
object.temperature.type
object.type
AMAZON.SearchAction<object@WeatherForecast[weatherCondition]> "what storms are nearby" object.location.addressLocality.name
object.spatialRelation
object.location.addressCountry.name
object.weatherCondition.name
object.startDate
object.duration
object.location.addressRegion.name
object.startTime
object.type

SearchAction<object@WeatherForecast>

User: tell me the forecast

Intent Schema:

{
    "intents": [
        {
            "name": "AMAZON.SearchAction<object@WeatherForecast>"
        }
    ]
}

Request:

{
    "request": {
        "type": "IntentRequest", 
        "locale": "en-US", 
        "intent": {
            "name": "AMAZON.SearchAction<object@WeatherForecast>", 
            "slots": {
                "object.type": {
                    "name": "object.type", 
                    "value": "forecast"
                }
            }
        }
    }
}

SearchAction<object@WeatherForecast[temperature]>

User: what's the low temperature tonight

Intent Schema:

{
    "intents": [
        {
            "name": "AMAZON.SearchAction<object@WeatherForecast[temperature]>"
        }
    ]
}

Request:

{
    "request": {
        "type": "IntentRequest", 
        "locale": "en-US", 
        "intent": {
            "name": "AMAZON.SearchAction<object@WeatherForecast[temperature]>", 
            "slots": {
                "object.temperature.type": {
                    "name": "object.temperature.type", 
                    "value": "low temperature"
                }, 
                "object.startTime": {
                    "name": "object.startTime", 
                    "value": "NI"
                }
            }
        }
    }
}

SearchAction<object@WeatherForecast[weatherCondition]>

User: what storms are nearby

Intent Schema:

{
    "intents": [
        {
            "name": "AMAZON.SearchAction<object@WeatherForecast[weatherCondition]>"
        }
    ]
}

Request:

{
    "request": {
        "type": "IntentRequest", 
        "locale": "en-US", 
        "intent": {
            "name": "AMAZON.SearchAction<object@WeatherForecast[weatherCondition]>", 
            "slots": {
                "object.weatherCondition.name": {
                    "name": "object.weatherCondition.name", 
                    "value": "storms"
                }, 
                "object.spatialRelation": {
                    "name": "object.spatialRelation", 
                    "value": "nearby"
                }
            }
        }
    }
}

WeatherForecast Slots

The WeatherForecast intents can return slot values to your skill. You do not include these slots in your intent schema – they are generated automatically from the intent signature.

Note that not all available slots are returned from every intent. See the table in WeatherForecast Intents to see which slots are applicable to each intent.

The following table shows the slots the WeatherForecast intents can return. For each slot, the table includes:

  • The slot name.
  • An example utterance for the slot.
  • The JSON that would be sent to your skill for the sample utterance.
  • If applicable, the name of the slot type used by the slot. You can see details about slot types in the Slot Type Reference.
Slot Name Utterance Slot Values

object.duration

"…what's the seven day"

AMAZON.DURATION

{
    "name": "object.duration", 
    "value": "P7D"
}

object.location.addressCountry.name

"… in israel"

AMAZON.Country

{
    "name": "object.location.addressCountry.name", 
    "value": "israel"
}

object.location.addressLocality.name

"… in nags head"

AMAZON.US_CITY

{
    "name": "object.location.addressLocality.name", 
    "value": "nags head"
}

object.location.addressRegion.name

"… to florida"

AMAZON.US_STATE

{
    "name": "object.location.addressRegion.name", 
    "value": "florida"
}

object.spatialRelation

"… are playing near"

{
    "name": "object.spatialRelation", 
    "value": "near"
}

object.startDate

"…what's on may first"

AMAZON.DATE

{
    "name": "object.startDate", 
    "value": "2017-05-01"
}

object.startTime

"… nine o'clock"

AMAZON.TIME

{
    "name": "object.startTime", 
    "value": "09:00"
}

object.temperature.type

"…what's the temperature"

{
    "name": "object.temperature.type", 
    "value": "temperature"
}

object.type

"…what's the report"

{
    "name": "object.type", 
    "value": "report"
}

object.weatherCondition.name

"… for rain"

AMAZON.WeatherCondition

{
    "name": "object.weatherCondition.name", 
    "value": "rain"
}

Built-in Intent Library Documentation

WeatherForecast is used in the following built-in intent library category:

Navigate to all built-in intents in the Built-in Intent Library.

See all available slot types in the Slot Type Reference.

Learn more about using the built-in intent library:

Learn more about building your voice interface:

The built-in intent library incorporates material from Schema.org, which is licensed under the Creative Commons Attribution-ShareAlike License (version 3.0) (the "License"). You may not use this file except in compliance with the License. You may obtain a copy of the License at http://creativecommons.org/licenses/by-sa/3.0/. For questions, please contact us.


Was this page helpful?

Last updated: Nov 28, 2023