Skill context example: how does confidence work?

Hi,

I am working on a skill and need to use context because the word “temperature” is strongly owned by the mycroft weather skill.

This is my code:

#### Intents
# Conversation example
# user : netatmo
# mycroft : gives the station name (to get the context)
# user : home temperatures
# mycroft : says inside and outside temperatures
# user : temperature
# mycroft : says inside and outside temperatures

@intent_handler(IntentBuilder("NetatmoIntent").require("NetatmoKeyword"))
@adds_context('NetatmoContext')
def handle_netatmo_intent(self, message):             
    sta_name = self.data['devices'][0]['station_name']
    self.speak_dialog('netatmo',{"sta_name":sta_name})        
        
@intent_handler(IntentBuilder("HomeTemperaturesIntent").require("HomeTemperaturesKeyword").require('NetatmoContext'))
@adds_context('NetatmoContext') 
def handle_home_temperatures_intent(self, message):             
    temp_int = self.data['devices'][0]['dashboard_data']['Temperature']
    temp_ext = self.data['devices'][0]['modules'][0]['dashboard_data']['Temperature']
    self.speak_dialog('HomeTemperatures',{"temp_int":temp_int, "temp_ext":temp_ext})

NetatmoKeyword is “netatmo” and HomeTemperaturesKeyword are “home temperature” and “temperature”.

In this log I ask : “netatmo”, “home temperature” and “temperature”. With the last word, despite the context it’s the weather skill which wins.

09:1:25.278 - SKILLS - DEBUG - {“type”: “recognizer_loop:utterance”, “context”: null, “data”: {“utterances”: [“netatmo”], “lang”: “en-us”}}
09:1:25.288 - SKILLS - DEBUG - {“data”: {“utterances”: [“netatmo”], “skill_id”: “mycroft-date-time.mycroftai”, “lang”: “en-us”}, “context”: null, “type”: “skill.converse.request”}
09:1:25.309 - SKILLS - DEBUG - {“data”: {“skill_id”: “mycroft-date-time.mycroftai”, “result”: false}, “context”: {}, “type”: “skill.converse.response”}
09:1:25.410 - SKILLS - DEBUG - {“data”: {“target”: null, “tags”: [{“start_token”: 0, “key”: “netatmo”, “entities”: [{“data”: [[“Netatmo”, “netatmo_weather_henridbrNetatmoKeyword”]], “confidence”: 1.0, “key”: “netatmo”, “match”: “netatmo”}], “end_token”: 0, “from_context”: false, “match”: “netatmo”}], “intent_type”: “netatmo-weather.henridbr:NetatmoIntent”, “netatmo_weather_henridbrNetatmoKeyword”: “Netatmo”, “utterance”: “netatmo”, “confidence”: 1.0}, “context”: {“target”: null}, “type”: “netatmo-weather.henridbr:NetatmoIntent”}
09:1:25.423 - SKILLS - DEBUG - {“data”: {“name”: “NetatmoWeatherSkill.handle_netatmo_intent”}, “context”: {“target”: null}, “type”: “mycroft.skill.handler.start”}
09:1:25.431 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): api.mycroft.ai:443
09:1:25.442 - SKILLS - DEBUG - {“data”: {“expect_response”: false, “utterance”: “do you need to know temperature from Netatmo station mto-swk?”}, “context”: {“target”: null}, “type”: “speak”}
09:1:25.487 - SKILLS - DEBUG - {“data”: {“word”: “”, “context”: “netatmo_weather_henridbrNetatmoContext”, “origin”: “”}, “context”: null, “type”: “add_context”}
09:1:25.491 - SKILLS - DEBUG - {“data”: {“name”: “NetatmoWeatherSkill.handle_netatmo_intent”}, “context”: {“target”: null}, “type”: “mycroft.skill.handler.complete”}
09:1:25.777 - urllib3.connectionpool - DEBUG - https://api.mycroft.ai:443 “GET /v1/device/3c44026f-9c7f-490e-9147-8404b6c9e94f/skill HTTP/1.1” 304 0
09:1:25.950 - urllib3.connectionpool - DEBUG - https://api.mycroft.ai:443 “POST /v1/device/3c44026f-9c7f-490e-9147-8404b6c9e94f/metric/timing HTTP/1.1” 200 271
09:1:26.014 - SKILLS - DEBUG - {“type”: “enclosure.eyes.blink”, “context”: null, “data”: {“side”: “b”}}
09:1:26.022 - SKILLS - DEBUG - {“type”: “recognizer_loop:audio_output_start”, “context”: null, “data”: {}}
09:1:29.146 - SKILLS - DEBUG - {“type”: “recognizer_loop:audio_output_end”, “context”: null, “data”: {}}
09:1:30.205 - SKILLS - DEBUG - {“data”: {}, “context”: null, “type”: “mycroft-date-time.mycroftai:TimeSkillupdate_display”}
09:1:35.208 - SKILLS - DEBUG - {“data”: “UpdateRemote”, “context”: null, “type”: “mycroft-configuration.mycroftai:ConfigurationSkillupdate_remote”}
09:1:35.216 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): api.mycroft.ai:443
09:1:35.713 - urllib3.connectionpool - DEBUG - https://api.mycroft.ai:443 “GET /v1/device/3c44026f-9c7f-490e-9147-8404b6c9e94f/setting HTTP/1.1” 304 0
09:1:35.730 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): api.mycroft.ai:443
09:1:36.194 - urllib3.connectionpool - DEBUG - https://api.mycroft.ai:443 “GET /v1/device/3c44026f-9c7f-490e-9147-8404b6c9e94f/location HTTP/1.1” 304 0
09:1:39.596 - SKILLS - DEBUG - {“type”: “recognizer_loop:utterance”, “context”: null, “data”: {“utterances”: [“home temperature”], “lang”: “en-us”}}
09:1:39.612 - SKILLS - DEBUG - {“data”: {“utterances”: [“home temperature”], “skill_id”: “netatmo-weather.henridbr”, “lang”: “en-us”}, “context”: null, “type”: “skill.converse.request”}
09:1:39.620 - SKILLS - DEBUG - {“data”: {“skill_id”: “netatmo-weather.henridbr”, “result”: false}, “context”: {}, “type”: “skill.converse.response”}
09:1:39.713 - SKILLS - DEBUG - {“data”: {“utterances”: [“home temperature”], “skill_id”: “mycroft-date-time.mycroftai”, “lang”: “en-us”}, “context”: null, “type”: “skill.converse.request”}
09:1:39.719 - SKILLS - DEBUG - {“data”: {“skill_id”: “mycroft-date-time.mycroftai”, “result”: false}, “context”: {}, “type”: “skill.converse.response”}
1
09:1:39.844 - SKILLS - DEBUG - {“data”: {“target”: null, “tags”: [{“start_token”: 0, “key”: “home temperature”, “match”: “home temperature”, “end_token”: 1, “from_context”: false, “confidence”: 1.0, “entities”: [{“data”: [[“home temperature”, “netatmo_weather_henridbrHomeTemperaturesKeyword”]], “confidence”: 1.0, “key”: “home temperature”, “match”: “home temperature”}]}, {“entities”: [{“match”: “”, “data”: [[“”, “netatmo_weather_henridbrNetatmoContext”]], “confidence”: 0.5, “origin”: “”, “key”: “”}]}], “intent_type”: “netatmo-weather.henridbr:HomeTemperaturesIntent”, “netatmo_weather_henridbrNetatmoContext”: “”, “utterance”: “home temperature”, “netatmo_weather_henridbrHomeTemperaturesKeyword”: “home temperature”, “confidence”: 0.375}, “context”: {“target”: null}, “type”: “netatmo-weather.henridbr:HomeTemperaturesIntent”}
09:1:39.854 - SKILLS - DEBUG - {“data”: {“name”: “NetatmoWeatherSkill.handle_home_temperatures_intent”}, “context”: {“target”: null}, “type”: “mycroft.skill.handler.start”}
09:1:39.860 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): api.mycroft.ai:443
09:1:39.874 - SKILLS - DEBUG - {“data”: {“expect_response”: false, “utterance”: “Home temperature is 20.7 degrees and outside temperature is 9.9 degrees.”}, “context”: {“target”: null}, “type”: “speak”}
09:1:39.881 - SKILLS - DEBUG - {“data”: {“word”: “”, “context”: “netatmo_weather_henridbrNetatmoContext”, “origin”: “”}, “context”: null, “type”: “add_context”}
09:1:39.918 - SKILLS - DEBUG - {“data”: {“name”: “NetatmoWeatherSkill.handle_home_temperatures_intent”}, “context”: {“target”: null}, “type”: “mycroft.skill.handler.complete”}
09:1:40.226 - SKILLS - DEBUG - {“data”: {}, “context”: null, “type”: “mycroft-date-time.mycroftai:TimeSkillupdate_display”}
09:1:40.353 - urllib3.connectionpool - DEBUG - https://api.mycroft.ai:443 “POST /v1/device/3c44026f-9c7f-490e-9147-8404b6c9e94f/metric/timing HTTP/1.1” 200 279
09:1:40.528 - SKILLS - DEBUG - {“type”: “enclosure.eyes.blink”, “context”: null, “data”: {“side”: “b”}}
09:1:40.537 - SKILLS - DEBUG - {“type”: “recognizer_loop:audio_output_start”, “context”: null, “data”: {}}
09:1:45.115 - SKILLS - DEBUG - {“type”: “recognizer_loop:audio_output_end”, “context”: null, “data”: {}}
09:1:49.842 - SKILLS - DEBUG - {“type”: “recognizer_loop:utterance”, “context”: null, “data”: {“utterances”: [“temperature”], “lang”: “en-us”}}
09:1:49.859 - SKILLS - DEBUG - {“data”: {“utterances”: [“temperature”], “skill_id”: “netatmo-weather.henridbr”, “lang”: “en-us”}, “context”: null, “type”: “skill.converse.request”}
09:1:49.872 - SKILLS - DEBUG - {“data”: {“skill_id”: “netatmo-weather.henridbr”, “result”: false}, “context”: {}, “type”: “skill.converse.response”}
09:1:49.950 - SKILLS - DEBUG - {“data”: {“utterances”: [“temperature”], “skill_id”: “mycroft-date-time.mycroftai”, “lang”: “en-us”}, “context”: null, “type”: “skill.converse.request”}
09:1:49.960 - SKILLS - DEBUG - {“data”: {“skill_id”: “mycroft-date-time.mycroftai”, “result”: false}, “context”: {}, “type”: “skill.converse.response”}
1
2
09:1:50.067 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): api.mycroft.ai:443
09:1:50.074 - SKILLS - DEBUG - {“data”: {“target”: null, “tags”: [{“start_token”: 0, “key”: “temperature”, “entities”: [{“data”: [[“temperature”, “mycroft_weather_mycroftaiWeather”], [“temperature”, “netatmo_weather_henridbrHomeTemperaturesKeyword”]], “confidence”: 1.0, “key”: “temperature”, “match”: “temperature”}], “end_token”: 0, “from_context”: false, “match”: “temperature”}], “intent_type”: “mycroft-weather.mycroftai:handle_current_weather”, “mycroft_weather_mycroftaiWeather”: “temperature”, “utterance”: “temperature”, “confidence”: 0.5}, “context”: {“target”: null}, “type”: “mycroft-weather.mycroftai:handle_current_weather”}
09:1:50.096 - SKILLS - DEBUG - {“data”: {“name”: “WeatherSkill.handle_current_weather”}, “context”: {“target”: null}, “type”: “mycroft.skill.handler.start”}
09:1:50.097 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): api.mycroft.ai:443
09:1:50.241 - SKILLS - DEBUG - {“data”: {}, “context”: null, “type”: “mycroft-date-time.mycroftai:TimeSkillupdate_display”}
09:1:50.558 - urllib3.connectionpool - DEBUG - https://api.mycroft.ai:443 “POST /v1/device/3c44026f-9c7f-490e-9147-8404b6c9e94f/metric/timing HTTP/1.1” 200 273
09:1:50.748 - urllib3.connectionpool - DEBUG - https://api.mycroft.ai:443 “GET /v1/owm/weather?lang=en&lon=-4.097899&lat=47.997542 HTTP/1.1” 200 497
09:1:50.770 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): api.mycroft.ai:443
09:1:51.405 - urllib3.connectionpool - DEBUG - https://api.mycroft.ai:443 “GET /v1/owm/forecast/daily?lang=en&lon=-4.097899&lat=47.997542 HTTP/1.1” 200 1987
09:1:51.425 - SKILLS - DEBUG - {“data”: {}, “context”: null, “type”: “enclosure.mouth.events.deactivate”}
09:1:51.432 - SKILLS - DEBUG - {“data”: {“img_code”: 4, “temp”: “5”}, “context”: null, “type”: “enclosure.weather.display”}
09:1:51.452 - SKILLS - DEBUG - {“data”: {“expect_response”: false, “utterance”: “Right now, it’s light rain and 5 degrees, for a high of 14 and a low of 5.”}, “context”: {“target”: null}, “type”: “speak”}
09:1:53.244 - SKILLS - DEBUG - {“data”: {}, “context”: null, “type”: “mycroft-reminder.mycroftai:reminder”}
09:1:53.265 - SKILLS - DEBUG - {“type”: “recognizer_loop:audio_output_start”, “context”: null, “data”: {}}
09:1:56.348 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): api.mycroft.ai:443
09:1:56.907 - urllib3.connectionpool - DEBUG - https://api.mycroft.ai:443 “GET /v1/device/3c44026f-9c7f-490e-9147-8404b6c9e94f/skill HTTP/1.1” 304 0
09:1:56.990 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): api.mycroft.ai:443
09:1:57.497 - urllib3.connectionpool - DEBUG - https://api.mycroft.ai:443 “GET /v1/device/3c44026f-9c7f-490e-9147-8404b6c9e94f/skill HTTP/1.1” 304 0
09:1:57.592 - SKILLS - DEBUG - {“type”: “recognizer_loop:audio_output_end”, “context”: null, “data”: {}}
09:1:57.613 - SKILLS - DEBUG - {“data”: {}, “context”: null, “type”: “enclosure.mouth.events.activate”}
09:1:57.658 - SKILLS - DEBUG - {“data”: {}, “context”: null, “type”: “enclosure.mouth.reset”}
09:1:57.663 - SKILLS - DEBUG - {“data”: {“name”: “WeatherSkill.handle_current_weather”}, “context”: {“target”: null}, “type”: “mycroft.skill.handler.complete”}
09:2:00.258 - SKILLS - DEBUG - {“data”: {}, “context”: null, “type”: “mycroft-date-time.mycroftai:TimeSkillupdate_display”}
09:2:00.304 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): api.mycroft.ai:443
09:2:00.797 - urllib3.connectionpool - DEBUG - https://api.mycroft.ai:443 “GET /v1/device/3c44026f-9c7f-490e-9147-8404b6c9e94f/skill HTTP/1.1” 304 0
09:2:02.004 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): api.mycroft.ai:443
09:2:02.527 - urllib3.connectionpool - DEBUG - https://api.mycroft.ai:443 “GET /v1/device/3c44026f-9c7f-490e-9147-8404b6c9e94f/skill HTTP/1.1” 304 0
09:2:03.290 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): api.mycroft.ai:443
09:2:03.806 - urllib3.connectionpool - DEBUG - https://api.mycroft.ai:443 “GET /v1/device/3c44026f-9c7f-490e-9147-8404b6c9e94f/skill HTTP/1.1” 304 0
09:2:10.273 - SKILLS - DEBUG - {“data”: {}, “context”: null, “type”: “mycroft-date-time.mycroftai:TimeSkillupdate_display”}
09:2:13.858 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): api.mycroft.ai:443
09:2:14.356 - urllib3.connectionpool - DEBUG - https://api.mycroft.ai:443 “GET /v1/device/3c44026f-9c7f-490e-9147-8404b6c9e94f/skill HTTP/1.1” 304 0
09:2:14.544 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): api.mycroft.ai:443
09:2:15.057 - urllib3.connectionpool - DEBUG - https://api.mycroft.ai:443 “GET /v1/device/3c44026f-9c7f-490e-9147-8404b6c9e94f/skill HTTP/1.1” 304 0
09:2:16.703 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): api.mycroft.ai:443
09:2:17.205 - urllib3.connectionpool - DEBUG - https://api.mycroft.ai:443 “GET /v1/device/3c44026f-9c7f-490e-9147-8404b6c9e94f/skill HTTP/1.1” 304 0
09:2:20.289 - SKILLS - DEBUG - {“data”: {}, “context”: null, “type”: “mycroft-date-time.mycroftai:TimeSkillupdate_display”}
09:2:23.292 - SKILLS - DEBUG - {“data”: {}, “context”: null, “type”: “mycroft-reminder.mycroftai:reminder”}
09:2:25.796 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): api.mycroft.ai:443
09:2:26.524 - urllib3.connectionpool - DEBUG - https://api.mycroft.ai:443 “GET /v1/device/3c44026f-9c7f-490e-9147-8404b6c9e94f/skill HTTP/1.1” 304 0
09:2:30.308 - SKILLS - DEBUG - {“data”: {}, “context”: null, “type”: “mycroft-date-time.mycroftai:TimeSkillupdate_display”}
09:2:35.321 - SKILLS - DEBUG - {“data”: “UpdateRemote”, “context”: null, “type”: “mycroft-configuration.mycroftai:ConfigurationSkillupdate_remote”}
09:2:35.337 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): api.mycroft.ai:443
09:2:35.837 - urllib3.connectionpool - DEBUG - https://api.mycroft.ai:443 “GET /v1/device/3c44026f-9c7f-490e-9147-8404b6c9e94f/setting HTTP/1.1” 304 0
09:2:35.853 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): api.mycroft.ai:443
09:2:36.528 - urllib3.connectionpool - DEBUG - https://api.mycroft.ai:443 “GET /v1/device/3c44026f-9c7f-490e-9147-8404b6c9e94f/location HTTP/1.1” 304 0
09:2:40.322 - SKILLS - DEBUG - {“data”: {}, “context”: null, “type”: “mycroft-date-time.mycroftai:TimeSkillupdate_display”}
09:2:50.336 - SKILLS - DEBUG - {“data”: {}, “context”: null, “type”: “mycroft-date-time.mycroftai:TimeSkillupdate_display”}
09:2:53.342 - SKILLS - DEBUG - {“data”: {}, “context”: null, “type”: “mycroft-reminder.mycroftai:reminder”}
09:2:56.928 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): api.mycroft.ai:443
09:2:57.484 - urllib3.connectionpool - DEBUG - https://api.mycroft.ai:443 “GET /v1/device/3c44026f-9c7f-490e-9147-8404b6c9e94f/skill HTTP/1.1” 304 0
09:2:57.529 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): api.mycroft.ai:443
09:2:58.004 - urllib3.connectionpool - DEBUG - https://api.mycroft.ai:443 “GET /v1/device/3c44026f-9c7f-490e-9147-8404b6c9e94f/skill HTTP/1.1” 304 0
09:3:00.353 - SKILLS - DEBUG - {“data”: {}, “context”: null, “type”: “mycroft-date-time.mycroftai:TimeSkillupdate_display”}
09:3:00.816 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): api.mycroft.ai:443
09:3:01.329 - urllib3.connectionpool - DEBUG - https://api.mycroft.ai:443 “GET /v1/device/3c44026f-9c7f-490e-9147-8404b6c9e94f/skill HTTP/1.1” 304 0
09:3:02.546 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): api.mycroft.ai:443
09:3:03.035 - urllib3.connectionpool - DEBUG - https://api.mycroft.ai:443 “GET /v1/device/3c44026f-9c7f-490e-9147-8404b6c9e94f/skill HTTP/1.1” 304 0
09:3:03.826 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): api.mycroft.ai:443
09:3:04.351 - urllib3.connectionpool - DEBUG - https://api.mycroft.ai:443 “GET /v1/device/3c44026f-9c7f-490e-9147-8404b6c9e94f/skill HTTP/1.1” 304 0
09:3:10.377 - SKILLS - DEBUG - {“data”: {}, “context”: null, “type”: “mycroft-date-time.mycroftai:TimeSkillupdate_display”}
09:3:14.381 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): api.mycroft.ai:443
09:3:14.883 - urllib3.connectionpool - DEBUG - https://api.mycroft.ai:443 “GET /v1/device/3c44026f-9c7f-490e-9147-8404b6c9e94f/skill HTTP/1.1” 304 0
09:3:15.075 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): api.mycroft.ai:443
09:3:15.598 - urllib3.connectionpool - DEBUG - https://api.mycroft.ai:443 “GET /v1/device/3c44026f-9c7f-490e-9147-8404b6c9e94f/skill HTTP/1.1” 304 0
09:3:17.227 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): api.mycroft.ai:443
09:3:17.734 - urllib3.connectionpool - DEBUG - https://api.mycroft.ai:443 “GET /v1/device/3c44026f-9c7f-490e-9147-8404b6c9e94f/skill HTTP/1.1” 304 0
09:3:20.395 - SKILLS - DEBUG - {“data”: {}, “context”: null, “type”: “mycroft-date-time.mycroftai:TimeSkillupdate_display”}
09:3:23.396 - SKILLS - DEBUG - {“data”: {}, “context”: null, “type”: “mycroft-reminder.mycroftai:reminder”}
09:3:26.552 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): api.mycroft.ai:443
09:3:27.047 - urllib3.connectionpool - DEBUG - https://api.mycroft.ai:443 “GET /v1/device/3c44026f-9c7f-490e-9147-8404b6c9e94f/skill HTTP/1.1” 304 0
09:3:30.407 - SKILLS - DEBUG - {“data”: {}, “context”: null, “type”: “mycroft-date-time.mycroftai:TimeSkillupdate_display”}
09:3:35.418 - SKILLS - DEBUG - {“data”: “UpdateRemote”, “context”: null, “type”: “mycroft-configuration.mycroftai:ConfigurationSkillupdate_remote”}
09:3:35.436 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): api.mycroft.ai:443
09:3:35.961 - urllib3.connectionpool - DEBUG - https://api.mycroft.ai:443 “GET /v1/device/3c44026f-9c7f-490e-9147-8404b6c9e94f/setting HTTP/1.1” 304 0
09:3:35.977 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): api.mycroft.ai:443
09:3:36.504 - urllib3.connectionpool - DEBUG - https://api.mycroft.ai:443 “GET /v1/device/3c44026f-9c7f-490e-9147-8404b6c9e94f/location HTTP/1.1” 304 0
09:3:40.426 - SKILLS - DEBUG - {“data”: {}, “context”: null, “type”: “mycroft-date-time.mycroftai:TimeSkillupdate_display”}
09:3:50.441 - SKILLS - DEBUG - {“data”: {}, “context”: null, “type”: “mycroft-date-time.mycroftai:TimeSkillupdate_display”}
09:3:53.449 - SKILLS - DEBUG - {“data”: {}, “context”: null, “type”: “mycroft-reminder.mycroftai:reminder”}
09:3:57.508 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): api.mycroft.ai:443
09:3:57.976 - urllib3.connectionpool - DEBUG - https://api.mycroft.ai:443 “GET /v1/device/3c44026f-9c7f-490e-9147-8404b6c9e94f/skill HTTP/1.1” 304 0
09:3:58.033 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): api.mycroft.ai:443
09:3:58.523 - urllib3.connectionpool - DEBUG - https://api.mycroft.ai:443 “GET /v1/device/3c44026f-9c7f-490e-9147-8404b6c9e94f/skill HTTP/1.1” 304 0
09:3:58.639 - SKILLS - DEBUG - {“type”: “recognizer_loop:utterance”, “context”: null, “data”: {“utterances”: [“netatmo”], “lang”: “en-us”}}
09:3:58.656 - SKILLS - DEBUG - {“data”: {“utterances”: [“netatmo”], “skill_id”: “mycroft-weather.mycroftai”, “lang”: “en-us”}, “context”: null, “type”: “skill.converse.request”}
09:3:58.662 - SKILLS - DEBUG - {“data”: {“skill_id”: “mycroft-weather.mycroftai”, “result”: false}, “context”: {}, “type”: “skill.converse.response”}
09:3:58.752 - SKILLS - DEBUG - {“data”: {“utterances”: [“netatmo”], “skill_id”: “netatmo-weather.henridbr”, “lang”: “en-us”}, “context”: null, “type”: “skill.converse.request”}
09:3:58.759 - SKILLS - DEBUG - {“data”: {“skill_id”: “netatmo-weather.henridbr”, “result”: false}, “context”: {}, “type”: “skill.converse.response”}
09:3:58.853 - SKILLS - DEBUG - {“data”: {“utterances”: [“netatmo”], “skill_id”: “mycroft-date-time.mycroftai”, “lang”: “en-us”}, “context”: null, “type”: “skill.converse.request”}
09:3:58.859 - SKILLS - DEBUG - {“data”: {“skill_id”: “mycroft-date-time.mycroftai”, “result”: false}, “context”: {}, “type”: “skill.converse.response”}
09:3:58.976 - SKILLS - DEBUG - {“data”: {“target”: null, “tags”: [{“start_token”: 0, “key”: “netatmo”, “entities”: [{“data”: [[“Netatmo”, “netatmo_weather_henridbrNetatmoKeyword”]], “confidence”: 1.0, “key”: “netatmo”, “match”: “netatmo”}], “end_token”: 0, “from_context”: false, “match”: “netatmo”}], “intent_type”: “netatmo-weather.henridbr:NetatmoIntent”, “netatmo_weather_henridbrNetatmoKeyword”: “Netatmo”, “utterance”: “netatmo”, “confidence”: 1.0}, “context”: {“target”: null}, “type”: “netatmo-weather.henridbr:NetatmoIntent”}
09:3:58.982 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): api.mycroft.ai:443
09:3:58.992 - SKILLS - DEBUG - {“data”: {“name”: “NetatmoWeatherSkill.handle_netatmo_intent”}, “context”: {“target”: null}, “type”: “mycroft.skill.handler.start”}
09:3:59.004 - SKILLS - DEBUG - {“data”: {“expect_response”: false, “utterance”: “do you need to know temperature from Netatmo station mto-swk?”}, “context”: {“target”: null}, “type”: “speak”}
09:3:59.007 - SKILLS - DEBUG - {“data”: {“word”: “”, “context”: “netatmo_weather_henridbrNetatmoContext”, “origin”: “”}, “context”: null, “type”: “add_context”}
09:3:59.023 - SKILLS - DEBUG - {“data”: {“name”: “NetatmoWeatherSkill.handle_netatmo_intent”}, “context”: {“target”: null}, “type”: “mycroft.skill.handler.complete”}
09:3:59.522 - urllib3.connectionpool - DEBUG - https://api.mycroft.ai:443 “POST /v1/device/3c44026f-9c7f-490e-9147-8404b6c9e94f/metric/timing HTTP/1.1” 200 270
09:4:00.223 - SKILLS - DEBUG - {“type”: “enclosure.eyes.blink”, “context”: null, “data”: {“side”: “b”}}
09:4:00.252 - SKILLS - DEBUG - {“type”: “recognizer_loop:audio_output_start”, “context”: null, “data”: {}}
09:4:00.464 - SKILLS - DEBUG - {“data”: {}, “context”: null, “type”: “mycroft-date-time.mycroftai:TimeSkillupdate_display”}
09:4:01.364 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): api.mycroft.ai:443
09:4:01.906 - urllib3.connectionpool - DEBUG - https://api.mycroft.ai:443 “GET /v1/device/3c44026f-9c7f-490e-9147-8404b6c9e94f/skill HTTP/1.1” 304 0
09:4:03.053 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): api.mycroft.ai:443
09:4:03.360 - SKILLS - DEBUG - {“type”: “recognizer_loop:audio_output_end”, “context”: null, “data”: {}}
09:4:03.634 - urllib3.connectionpool - DEBUG - https://api.mycroft.ai:443 “GET /v1/device/3c44026f-9c7f-490e-9147-8404b6c9e94f/skill HTTP/1.1” 304 0
09:4:04.372 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): api.mycroft.ai:443
09:4:04.876 - urllib3.connectionpool - DEBUG - https://api.mycroft.ai:443 “GET /v1/device/3c44026f-9c7f-490e-9147-8404b6c9e94f/skill HTTP/1.1” 304 0
09:4:08.424 - SKILLS - DEBUG - {“type”: “recognizer_loop:utterance”, “context”: null, “data”: {“utterances”: [“home temperature”], “lang”: “en-us”}}
09:4:08.430 - SKILLS - DEBUG - {“data”: {“utterances”: [“home temperature”], “skill_id”: “netatmo-weather.henridbr”, “lang”: “en-us”}, “context”: null, “type”: “skill.converse.request”}
09:4:08.443 - SKILLS - DEBUG - {“data”: {“skill_id”: “netatmo-weather.henridbr”, “result”: false}, “context”: {}, “type”: “skill.converse.response”}
09:4:08.531 - SKILLS - DEBUG - {“data”: {“utterances”: [“home temperature”], “skill_id”: “mycroft-weather.mycroftai”, “lang”: “en-us”}, “context”: null, “type”: “skill.converse.request”}
09:4:08.539 - SKILLS - DEBUG - {“data”: {“skill_id”: “mycroft-weather.mycroftai”, “result”: false}, “context”: {}, “type”: “skill.converse.response”}
09:4:08.635 - SKILLS - DEBUG - {“data”: {“utterances”: [“home temperature”], “skill_id”: “mycroft-date-time.mycroftai”, “lang”: “en-us”}, “context”: null, “type”: “skill.converse.request”}
09:4:08.643 - SKILLS - DEBUG - {“data”: {“skill_id”: “mycroft-date-time.mycroftai”, “result”: false}, “context”: {}, “type”: “skill.converse.response”}
1
09:4:08.766 - SKILLS - DEBUG - {“data”: {“target”: null, “tags”: [{“start_token”: 0, “key”: “home temperature”, “match”: “home temperature”, “end_token”: 1, “from_context”: false, “confidence”: 1.0, “entities”: [{“data”: [[“home temperature”, “netatmo_weather_henridbrHomeTemperaturesKeyword”]], “confidence”: 1.0, “key”: “home temperature”, “match”: “home temperature”}]}, {“entities”: [{“match”: “”, “data”: [[“”, “netatmo_weather_henridbrNetatmoContext”]], “confidence”: 0.5, “origin”: “”, “key”: “”}]}], “intent_type”: “netatmo-weather.henridbr:HomeTemperaturesIntent”, “netatmo_weather_henridbrNetatmoContext”: “”, “utterance”: “home temperature”, “netatmo_weather_henridbrHomeTemperaturesKeyword”: “home temperature”, “confidence”: 0.375}, “context”: {“target”: null}, “type”: “netatmo-weather.henridbr:HomeTemperaturesIntent”}
09:4:08.779 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): api.mycroft.ai:443
09:4:08.792 - SKILLS - DEBUG - {“data”: {“name”: “NetatmoWeatherSkill.handle_home_temperatures_intent”}, “context”: {“target”: null}, “type”: “mycroft.skill.handler.start”}
09:4:08.836 - SKILLS - DEBUG - {“data”: {“expect_response”: false, “utterance”: “Home temperature is 20.7 degrees and outside temperature is 9.9 degrees.”}, “context”: {“target”: null}, “type”: “speak”}
09:4:08.859 - SKILLS - DEBUG - {“data”: {“word”: “”, “context”: “netatmo_weather_henridbrNetatmoContext”, “origin”: “”}, “context”: null, “type”: “add_context”}
09:4:08.862 - SKILLS - DEBUG - {“data”: {“name”: “NetatmoWeatherSkill.handle_home_temperatures_intent”}, “context”: {“target”: null}, “type”: “mycroft.skill.handler.complete”}
09:4:09.279 - urllib3.connectionpool - DEBUG - https://api.mycroft.ai:443 “POST /v1/device/3c44026f-9c7f-490e-9147-8404b6c9e94f/metric/timing HTTP/1.1” 200 278
09:4:09.625 - SKILLS - DEBUG - {“type”: “enclosure.eyes.blink”, “context”: null, “data”: {“side”: “b”}}
09:4:09.644 - SKILLS - DEBUG - {“type”: “recognizer_loop:audio_output_start”, “context”: null, “data”: {}}
09:4:10.483 - SKILLS - DEBUG - {“data”: {}, “context”: null, “type”: “mycroft-date-time.mycroftai:TimeSkillupdate_display”}
09:4:14.219 - SKILLS - DEBUG - {“type”: “recognizer_loop:audio_output_end”, “context”: null, “data”: {}}
09:4:14.902 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): api.mycroft.ai:443
09:4:15.429 - urllib3.connectionpool - DEBUG - https://api.mycroft.ai:443 “GET /v1/device/3c44026f-9c7f-490e-9147-8404b6c9e94f/skill HTTP/1.1” 304 0
09:4:15.622 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): api.mycroft.ai:443
09:4:16.085 - urllib3.connectionpool - DEBUG - https://api.mycroft.ai:443 “GET /v1/device/3c44026f-9c7f-490e-9147-8404b6c9e94f/skill HTTP/1.1” 304 0
09:4:17.745 - SKILLS - DEBUG - {“type”: “recognizer_loop:utterance”, “context”: null, “data”: {“utterances”: [“temperature”], “lang”: “en-us”}}
09:4:17.759 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): api.mycroft.ai:443
09:4:17.761 - SKILLS - DEBUG - {“data”: {“utterances”: [“temperature”], “skill_id”: “netatmo-weather.henridbr”, “lang”: “en-us”}, “context”: null, “type”: “skill.converse.request”}
09:4:17.772 - SKILLS - DEBUG - {“data”: {“skill_id”: “netatmo-weather.henridbr”, “result”: false}, “context”: {}, “type”: “skill.converse.response”}
09:4:17.867 - SKILLS - DEBUG - {“data”: {“utterances”: [“temperature”], “skill_id”: “mycroft-weather.mycroftai”, “lang”: “en-us”}, “context”: null, “type”: “skill.converse.request”}
09:4:17.873 - SKILLS - DEBUG - {“data”: {“skill_id”: “mycroft-weather.mycroftai”, “result”: false}, “context”: {}, “type”: “skill.converse.response”}
09:4:17.968 - SKILLS - DEBUG - {“data”: {“utterances”: [“temperature”], “skill_id”: “mycroft-date-time.mycroftai”, “lang”: “en-us”}, “context”: null, “type”: “skill.converse.request”}
09:4:17.976 - SKILLS - DEBUG - {“data”: {“skill_id”: “mycroft-date-time.mycroftai”, “result”: false}, “context”: {}, “type”: “skill.converse.response”}
1
2
09:4:18.092 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): api.mycroft.ai:443
09:4:18.098 - SKILLS - DEBUG - {“data”: {“target”: null, “tags”: [{“start_token”: 0, “key”: “temperature”, “entities”: [{“data”: [[“temperature”, “mycroft_weather_mycroftaiWeather”], [“temperature”, “netatmo_weather_henridbrHomeTemperaturesKeyword”]], “confidence”: 1.0, “key”: “temperature”, “match”: “temperature”}], “end_token”: 0, “from_context”: false, “match”: “temperature”}], “intent_type”: “mycroft-weather.mycroftai:handle_current_weather”, “mycroft_weather_mycroftaiWeather”: “temperature”, “utterance”: “temperature”, “confidence”: 0.5}, “context”: {“target”: null}, “type”: “mycroft-weather.mycroftai:handle_current_weather”}
09:4:18.113 - SKILLS - DEBUG - {“data”: {“name”: “WeatherSkill.handle_current_weather”}, “context”: {“target”: null}, “type”: “mycroft.skill.handler.start”}
09:4:18.123 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): api.mycroft.ai:443
09:4:18.227 - urllib3.connectionpool - DEBUG - https://api.mycroft.ai:443 “GET /v1/device/3c44026f-9c7f-490e-9147-8404b6c9e94f/skill HTTP/1.1” 304 0
09:4:18.590 - urllib3.connectionpool - DEBUG - https://api.mycroft.ai:443 “POST /v1/device/3c44026f-9c7f-490e-9147-8404b6c9e94f/metric/timing HTTP/1.1” 200 273
09:4:18.907 - urllib3.connectionpool - DEBUG - https://api.mycroft.ai:443 “GET /v1/owm/weather?lang=en&lon=-4.097899&lat=47.997542 HTTP/1.1” 200 497
09:4:18.924 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): api.mycroft.ai:443
09:4:19.550 - urllib3.connectionpool - DEBUG - https://api.mycroft.ai:443 “GET /v1/owm/forecast/daily?lang=en&lon=-4.097899&lat=47.997542 HTTP/1.1” 200 1987
09:4:19.566 - SKILLS - DEBUG - {“data”: {}, “context”: null, “type”: “enclosure.mouth.events.deactivate”}
09:4:19.571 - SKILLS - DEBUG - {“data”: {“img_code”: 4, “temp”: “5”}, “context”: null, “type”: “enclosure.weather.display”}
09:4:19.585 - SKILLS - DEBUG - {“data”: {“expect_response”: false, “utterance”: “With a high of 14 and a low of 5, Quimper has light rain and is currently 5 degrees.”}, “context”: {“target”: null}, “type”: “speak”}
09:4:20.501 - SKILLS - DEBUG - {“data”: {}, “context”: null, “type”: “mycroft-date-time.mycroftai:TimeSkillupdate_display”}

The result of the competition on the word “temperature” between my skill context and mycroft weather skill is visible at 09:4:08.766.

Could someone explain how the confidence works in this case ?

Hi,

keywords from context are weighted as 50% and then further divided as they falls further back in memory.

I think the weather skill should be looked over since the weather intent is very open it will match on anything containing temperature.

An easier approach, if this is more of a back and forth dialog between the user and mycroft, might be to use the self.get_response() mechanism which waits and returns the text to the skill handler without going through adapt at all.

  answer = self.get_response('station.question')
  if 'foo' in answer:
    temperature = self.get_response('follow_up_question')

For linear sequences of interaction the self.get_response() is great. E.g. if you ware working through a series of questions or asking follow-up queries to get information that wasn’t included in original query. For example, you can easily handle this sort of interaction:
Hey Mycroft, create an appointment
> On what day?
Thursday at 5pm
> OK

Or
Hey Mycroft, create an appointment
> On what day?
Thursday
> At what time
5pm
> OK
You only invoke the get_response() if you don’t have the info yet.

If you are looking to do things in a more free-form way, you can override the converse() method or look at setting a context and including that context key as part of your intent. This is more useful for interactions like this:

Hey Mycroft, how old is Tom Cruise
> 56 years old
How tall is he?
> 5'7"

In that case, the first query would be handled by a regular intent handler which saves “Tom Cruise” as a ‘person’ context (for example), then the followup would be handled by a converse() that looks at the ‘person’ to be able to get the info. The converse() method of each skill gets triggered if the skill was recently invoked, in reverse order (e.g. the most recently triggered skill gets the first chance to capture the utterance from the user).

Hope that helps!

1 Like

Thank you @forslund and @steve.penrod

To evaluate the performance of how the utterance is coded, I guess reading the Skill log might help.

Here, “entities” contains the list of skills using the utterance “temperature”. A confidence of 1,0 is attributed to each of them (?). After that I am not sure the context is taken into account, could you help me to read this line ?