Lots of improvements for WeatherSkill
This commit is contained in:
parent
e954f4d1e7
commit
12119f4281
@ -15,237 +15,6 @@ class WeatherSkill(Skill, metaclass=SkillRegistering):
|
|||||||
def __init__(self, data=dict):
|
def __init__(self, data=dict):
|
||||||
super().__init__("WeatherSkill", data)
|
super().__init__("WeatherSkill", data)
|
||||||
|
|
||||||
|
|
||||||
@intent_handler(
|
|
||||||
IntentBuilder("handle_number_days_forecast")
|
|
||||||
.optionally("query")
|
|
||||||
.one_of("weather", "forecast")
|
|
||||||
.require("number-days")
|
|
||||||
.optionally("location")
|
|
||||||
)
|
|
||||||
# pas ouf
|
|
||||||
def handle_number_days_forecast(self, data):
|
|
||||||
"""Handle multiple day forecast without specified location.
|
|
||||||
|
|
||||||
Examples:
|
|
||||||
"What is the 3 day forecast?"
|
|
||||||
"What is the weather forecast?"
|
|
||||||
|
|
||||||
Args:
|
|
||||||
data Bus event information from the intent parser
|
|
||||||
"""
|
|
||||||
pass
|
|
||||||
|
|
||||||
@intent_handler(
|
|
||||||
IntentBuilder("handle_one_day_forecast")
|
|
||||||
.optionally("query")
|
|
||||||
.one_of("weather", "forecast")
|
|
||||||
.require("relative-day")
|
|
||||||
.optionally("location")
|
|
||||||
)
|
|
||||||
def handle_one_day_forecast(self, data):
|
|
||||||
"""Handle forecast for a single day.
|
|
||||||
|
|
||||||
Examples:
|
|
||||||
"What is the weather forecast tomorrow?"
|
|
||||||
"What is the weather forecast on Tuesday in Baltimore?"
|
|
||||||
|
|
||||||
Args:
|
|
||||||
data Bus event information from the intent parser
|
|
||||||
"""
|
|
||||||
pass
|
|
||||||
|
|
||||||
@intent_handler(
|
|
||||||
IntentBuilder("handle_weather_later")
|
|
||||||
.require("query")
|
|
||||||
.require("weather")
|
|
||||||
.require("later")
|
|
||||||
.optionally("location")
|
|
||||||
)
|
|
||||||
def handle_weather_later(self, data):
|
|
||||||
"""Handle future weather requests such as: what's the weather later?
|
|
||||||
|
|
||||||
Args:
|
|
||||||
data Bus event information from the intent parser
|
|
||||||
"""
|
|
||||||
pass
|
|
||||||
|
|
||||||
@intent_handler(
|
|
||||||
IntentBuilder("handle_weather_at_time")
|
|
||||||
.optionally("query")
|
|
||||||
.one_of("weather", "forecast")
|
|
||||||
.require("relative-time")
|
|
||||||
.optionally("relative-day")
|
|
||||||
.optionally("location")
|
|
||||||
)
|
|
||||||
def handle_weather_at_time(self, data):
|
|
||||||
"""Handle future weather requests such as: what's the weather tonight?
|
|
||||||
|
|
||||||
Args:
|
|
||||||
data Bus event information from the intent parser
|
|
||||||
"""
|
|
||||||
pass
|
|
||||||
|
|
||||||
@intent_handler(
|
|
||||||
IntentBuilder("handle_weekend_forecast")
|
|
||||||
.require("query")
|
|
||||||
.one_of("weather", "forecast")
|
|
||||||
.require("weekend")
|
|
||||||
.optionally("location")
|
|
||||||
)
|
|
||||||
def handle_weekend_forecast(self, data):
|
|
||||||
"""Handle requests for the weekend forecast.
|
|
||||||
|
|
||||||
Args:
|
|
||||||
data Bus event information from the intent parser
|
|
||||||
"""
|
|
||||||
pass
|
|
||||||
|
|
||||||
@intent_handler(
|
|
||||||
IntentBuilder("handle_week_weather")
|
|
||||||
.optionally("query")
|
|
||||||
.one_of("weather", "forecast")
|
|
||||||
.require("week")
|
|
||||||
.optionally("location")
|
|
||||||
)
|
|
||||||
def handle_week_weather(self, data):
|
|
||||||
"""Handle weather for week (i.e. seven days).
|
|
||||||
|
|
||||||
Args:
|
|
||||||
data Bus event information from the intent parser
|
|
||||||
"""
|
|
||||||
pass
|
|
||||||
|
|
||||||
@intent_handler(
|
|
||||||
IntentBuilder("handle_current_temperature")
|
|
||||||
.optionally("query")
|
|
||||||
.require("temperature")
|
|
||||||
.optionally("location")
|
|
||||||
.optionally("unit")
|
|
||||||
.optionally("today")
|
|
||||||
.optionally("now")
|
|
||||||
)
|
|
||||||
def handle_current_temperature(self, data):
|
|
||||||
"""Handle requests for current temperature.
|
|
||||||
|
|
||||||
Examples:
|
|
||||||
"What is the temperature in Celsius?"
|
|
||||||
"What is the temperature in Baltimore now?"
|
|
||||||
|
|
||||||
Args:
|
|
||||||
data Bus event information from the intent parser
|
|
||||||
"""
|
|
||||||
pass
|
|
||||||
|
|
||||||
@intent_handler(
|
|
||||||
IntentBuilder("handle_daily_temperature")
|
|
||||||
.optionally("query")
|
|
||||||
.require("temperature")
|
|
||||||
.require("relative-day")
|
|
||||||
.optionally("location")
|
|
||||||
.optionally("unit")
|
|
||||||
)
|
|
||||||
def handle_daily_temperature(self, data):
|
|
||||||
"""Handle simple requests for current temperature.
|
|
||||||
|
|
||||||
Examples: "What is the temperature?"
|
|
||||||
|
|
||||||
Args:
|
|
||||||
data Bus event information from the intent parser
|
|
||||||
"""
|
|
||||||
pass
|
|
||||||
|
|
||||||
@intent_handler(
|
|
||||||
IntentBuilder("handle_hourly_temperature")
|
|
||||||
.optionally("query")
|
|
||||||
.require("temperature")
|
|
||||||
.require("relative-time")
|
|
||||||
.optionally("relative-day")
|
|
||||||
.optionally("location")
|
|
||||||
)
|
|
||||||
def handle_hourly_temperature(self, data):
|
|
||||||
"""Handle requests for current temperature at a relative time.
|
|
||||||
|
|
||||||
Examples:
|
|
||||||
"What is the temperature tonight?"
|
|
||||||
"What is the temperature tomorrow morning?"
|
|
||||||
|
|
||||||
Args:
|
|
||||||
data Bus event information from the intent parser
|
|
||||||
"""
|
|
||||||
pass
|
|
||||||
|
|
||||||
@intent_handler(
|
|
||||||
IntentBuilder("handle_high_temperature")
|
|
||||||
.optionally("query")
|
|
||||||
.require("high")
|
|
||||||
.optionally("temperature")
|
|
||||||
.optionally("location")
|
|
||||||
.optionally("unit")
|
|
||||||
.optionally("relative-day")
|
|
||||||
.optionally("now")
|
|
||||||
.optionally("today")
|
|
||||||
)
|
|
||||||
def handle_high_temperature(self, data):
|
|
||||||
"""Handle a request for the high temperature.
|
|
||||||
|
|
||||||
Examples:
|
|
||||||
"What is the high temperature tomorrow?"
|
|
||||||
"What is the high temperature in London on Tuesday?"
|
|
||||||
|
|
||||||
Args:
|
|
||||||
data Bus event information from the intent parser
|
|
||||||
"""
|
|
||||||
pass
|
|
||||||
|
|
||||||
@intent_handler(
|
|
||||||
IntentBuilder("handle_low_temperature")
|
|
||||||
.optionally("query")
|
|
||||||
.require("low")
|
|
||||||
.optionally("temperature")
|
|
||||||
.optionally("location")
|
|
||||||
.optionally("unit")
|
|
||||||
.optionally("relative-day")
|
|
||||||
.optionally("now")
|
|
||||||
.optionally("today")
|
|
||||||
)
|
|
||||||
def handle_low_temperature(self, data):
|
|
||||||
"""Handle a request for the high temperature.
|
|
||||||
|
|
||||||
Examples:
|
|
||||||
"What is the high temperature tomorrow?"
|
|
||||||
"What is the high temperature in London on Tuesday?"
|
|
||||||
|
|
||||||
Args:
|
|
||||||
data Bus event information from the intent parser
|
|
||||||
"""
|
|
||||||
|
|
||||||
pass
|
|
||||||
|
|
||||||
@intent_handler(
|
|
||||||
IntentBuilder("handle_is_it_hot")
|
|
||||||
.require("confirm-query-current")
|
|
||||||
.one_of("hot", "cold")
|
|
||||||
.optionally("location")
|
|
||||||
.optionally("today")
|
|
||||||
)
|
|
||||||
def handle_is_it_hot(self, data):
|
|
||||||
"""Handler for temperature requests such as: is it going to be hot today?
|
|
||||||
|
|
||||||
Args:
|
|
||||||
data Bus event information from the intent parser
|
|
||||||
"""
|
|
||||||
pass
|
|
||||||
|
|
||||||
@intent_handler(
|
|
||||||
IntentBuilder("handle_how_hot_or_cold")
|
|
||||||
.optionally("query")
|
|
||||||
.one_of("hot", "cold")
|
|
||||||
.require("confirm-query")
|
|
||||||
.optionally("location")
|
|
||||||
.optionally("relative-day")
|
|
||||||
.optionally("today")
|
|
||||||
)
|
|
||||||
def handle_how_hot_or_cold(self, data):
|
def handle_how_hot_or_cold(self, data):
|
||||||
"""Handler for temperature requests such as: how cold will it be today?
|
"""Handler for temperature requests such as: how cold will it be today?
|
||||||
|
|
||||||
|
@ -10,6 +10,18 @@ class WeatherSkill(Skill, metaclass=SkillRegistering):
|
|||||||
def handle_weather(self, data):
|
def handle_weather(self, data):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@intent_file_handler("handle_temperature.intent", "HandleTemperatureIntent")
|
||||||
|
def handle_temperature(self, data):
|
||||||
|
pass
|
||||||
|
|
||||||
|
@intent_file_handler("handle_is_it_hot.intent", "HandleIsItHotIntent")
|
||||||
|
def handle_temperature(self, data):
|
||||||
|
pass
|
||||||
|
|
||||||
|
@intent_file_handler("handle_is_it_cold.intent", "HandleIsItColdIntent")
|
||||||
|
def handle_temperature(self, data):
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
def create_skill(data):
|
def create_skill(data):
|
||||||
return WeatherSkill(data)
|
return WeatherSkill(data)
|
||||||
|
@ -0,0 +1,2 @@
|
|||||||
|
def get_temperature():
|
||||||
|
return 20
|
@ -13,3 +13,6 @@ après demain
|
|||||||
après midi
|
après midi
|
||||||
aprèm
|
aprèm
|
||||||
après-midi
|
après-midi
|
||||||
|
soir
|
||||||
|
matin
|
||||||
|
ces prochains jours
|
@ -0,0 +1,2 @@
|
|||||||
|
est-ce qu'il va faire froid {day}
|
||||||
|
va t'il faire froid {day}
|
@ -0,0 +1,2 @@
|
|||||||
|
est-ce qu'il va faire chaud {day}
|
||||||
|
va t'il faire chaud {day}
|
@ -0,0 +1,10 @@
|
|||||||
|
ce sera quoi la température ((ce|cet|) {day}|) ((pour|les|de ces|ces) {forecast_days} (prochain|prochains|) jours|)
|
||||||
|
c'est quoi la température ((pour|les|de ces|ces) {forecast_days} (prochain|prochains|) jours|)
|
||||||
|
il fait quel température (dehors|) ((pour|les|de ces|ces) {forecast_days} (prochain|prochains|) jours|)
|
||||||
|
ca (ressemble à|donne) quoi la température (dehors|) ((pour|les|de ces|ces) {forecast_days} (prochain|prochains|) jours|)
|
||||||
|
donne moi la température ((pour|les|de ces|ces) {forecast_days} (prochain|prochains|) jours|)
|
||||||
|
donne moi la température (pour|de) (ce|cet|) {day} ((pour|les|de ces|ces) {forecast_days} (prochain|prochains|) jours|)
|
||||||
|
dis moi la température ((pour|les|de ces|ces) {forecast_days} (prochain|prochains|) jours|)
|
||||||
|
dis moi la température (pour|de) (ce|cet|) {day} ((pour|les|de ces|ces) {forecast_days} (prochain|prochains|) jours|)
|
||||||
|
il (fait|va faire) (quel température|combien) (dehors|) (soir|midi|après-midi|matin|) ((ce|cet|) {day}|) ((à|a|pour) {location}|)
|
||||||
|
il (fait|fera|va faire) (quelle|combien|) température (dehors|) ((ce|cet|) {day}|(pour|les|de ces|ces) {forecast_days} (prochain|prochains|) jours|) ((à|a|pour) {location}|)
|
@ -1,13 +1,13 @@
|
|||||||
ce sera quoi la météo ({day}|) ((pour|les|de ces|ces) {forecast_days} (prochain|prochains|) jours|)
|
ce sera quoi la météo ((ce|cet|) {day}|) ((pour|les|de ces|ces) {forecast_days} (prochain|prochains|) jours|)
|
||||||
c'est quoi la météo ((pour|les|de ces|ces) {forecast_days} (prochain|prochains|) jours|)
|
c'est quoi la météo ((pour|les|de ces|ces) {forecast_days} (prochain|prochains|) jours|)
|
||||||
il fait quel temps (dehors|) ((pour|les|de ces|ces) {forecast_days} (prochain|prochains|) jours|)
|
il fait quel temps (dehors|) ((pour|les|de ces|ces) {forecast_days} (prochain|prochains|) jours|)
|
||||||
ca (ressemble à|donne) quoi (la météo|dehors|le temps) ((pour|les|de ces|ces) {forecast_days} (prochain|prochains|) jours|)
|
ca (ressemble à|donne) quoi (la météo|dehors|le temps) ((pour|les|de ces|ces) {forecast_days} (prochain|prochains|) jours|)
|
||||||
donne moi la météo ((pour|les|de ces|ces) {forecast_days} (prochain|prochains|) jours|)
|
donne moi la météo ((pour|les|de ces|ces) {forecast_days} (prochain|prochains|) jours|)
|
||||||
donne moi la météo (pour|de) {day} ((pour|les|de ces|ces) {forecast_days} (prochain|prochains|) jours|)
|
donne moi la météo (pour|de) (ce|cet|) {day} ((pour|les|de ces|ces) {forecast_days} (prochain|prochains|) jours|)
|
||||||
dis moi la météo ((pour|les|de ces|ces) {forecast_days} (prochain|prochains|) jours|)
|
dis moi la météo ((pour|les|de ces|ces) {forecast_days} (prochain|prochains|) jours|)
|
||||||
dis moi la météo (pour|de) {day} ((pour|les|de ces|ces) {forecast_days} (prochain|prochains|) jours|)
|
dis moi la météo (pour|de) (ce|cet|) {day} ((pour|les|de ces|ces) {forecast_days} (prochain|prochains|) jours|)
|
||||||
il (fait|va faire) quel temps (dehors|) ({day}|) ((à|a|pour) {location}|)
|
il (fait|va faire) quel temps (dehors|) (soir|midi|après-midi|matin|) ((ce|cet|) {day}|) ((à|a|pour) {location}|)
|
||||||
il (fait|fera|va faire) (quel|quoi|) (temps|météo|) (dehors|) ({day}|(pour|les|de ces|ces) {forecast_days} (prochain|prochains|) jours|) ((à|a|pour) {location}|)
|
il (fait|fera|va faire) (quel|quoi|) (temps|météo|) (dehors|) ((ce|cet|) {day}|(pour|les|de ces|ces) {forecast_days} (prochain|prochains|) jours|) ((à|a|pour) {location}|)
|
||||||
donne moi les prévisions de la journée ((à|pour) {location}|)
|
donne moi les prévisions de la journée ((à|pour) {location}|)
|
||||||
(donne moi|ce sera quoi) les prévisions (météo|) pour {day} ((à|a|pour) {location}|)
|
(donne moi|ce sera quoi) les prévisions (météo|) pour (ce|cet|) {day} ((à|a|pour) {location}|)
|
||||||
(donne moi|ce sera quoi) les prévisions (météo|) ({day}|(pour|les|de ces|ces) {forecast_days} (prochain|prochains|) jours|) ((à|a|pour) {location}|)
|
(donne moi|ce sera quoi) les prévisions (météo|) ({day}|(pour|les|de ces|ces) {forecast_days} (prochain|prochains|) jours|) ((à|a|pour) {location}|)
|
Reference in New Issue
Block a user