JDureau / snips-skill-meteo

MIT License
1 stars 7 forks source link

Erreur TimeIntervalValue non définie #6

Open marcteyssier opened 5 years ago

marcteyssier commented 5 years ago

Bonjour,

J'utilise votre librairie pour avoir la météo sur Snips, mais je n'ai pas de retour audio. Dans le syslog, j'ai détecté qu'il y avait une erreur à cause de TimeIntervalValue qui n'est pas défini. Comment puis-je corriger l'erreur ?

Merci Marc

Oct 15 14:03:01 snips-master snips-skill-server[18195]: INFO:snips_skill_server_lib::runner            : [heure][out] ()
Oct 15 14:03:01 snips-master snips-skill-server[18195]: INFO:snips_skill_server_lib::runner            : [heure][out] Joseph:searchWeatherForecast
Oct 15 14:03:01 snips-master snips-skill-server[18195]: INFO:snips_skill_server_lib::runner            : [heure][out] ()
Oct 15 14:03:01 snips-master snips-skill-server[18195]: INFO:snips_skill_server_lib::runner            : [app_freebox_telecommande][out] [Recept] intent Joseph:searchWeatherForecast
Oct 15 14:03:01 snips-master snips-skill-server[18195]: INFO:snips_skill_server_lib::runner            : [meteo][err] Traceback (most recent call last):
Oct 15 14:03:01 snips-master snips-skill-server[18195]: INFO:snips_skill_server_lib::runner            : [meteo][err]   File "_ctypes/callbacks.c", line 315, in 'calling callback function'
Oct 15 14:03:01 snips-master snips-skill-server[18195]: INFO:snips_skill_server_lib::runner            : [meteo][err]   File "/var/lib/snips/skills/snips-skill-meteo/venv/local/lib/python2.7/site-packages/hermes_python/ffi/wrappers.py", line 61, in convert_arguments_when_invoking_function
Oct 15 14:03:01 snips-master snips-skill-server[18195]: INFO:snips_skill_server_lib::runner            : [meteo][err]     return func(hermes_client, *parsed_args)
Oct 15 14:03:01 snips-master snips-skill-server[18195]: INFO:snips_skill_server_lib::runner            : [meteo][err]   File "./action-meteo.py", line 205, in intent_received
Oct 15 14:03:01 snips-master snips-skill-server[18195]: INFO:snips_skill_server_lib::runner            : [meteo][err]   File "./action-meteo.py", line 80, in get_weather_forecast
Oct 15 14:03:01 snips-master snips-skill-server[18195]: INFO:snips_skill_server_lib::runner            : [meteo][err] KeyError: u'secret'
Oct 15 14:03:02 snips-master snips-skill-server[18195]: INFO:snips_skill_server_lib::runner            : [meteo][err] Traceback (most recent call last):
Oct 15 14:03:02 snips-master snips-skill-server[18195]: INFO:snips_skill_server_lib::runner            : [meteo][err]   File "_ctypes/callbacks.c", line 315, in 'calling callback function'
Oct 15 14:03:02 snips-master snips-skill-server[18195]: INFO:snips_skill_server_lib::runner            : [meteo][err]   File "/var/lib/snips/skills/snips-skill-meteo/venv/local/lib/python2.7/site-packages/hermes_python/ffi/wrappers.py", line 61, in convert_arguments_when_invoking_function
Oct 15 14:03:02 snips-master snips-skill-server[18195]: INFO:snips_skill_server_lib::runner            : [meteo][err]     return func(hermes_client, *parsed_args)
Oct 15 14:03:02 snips-master snips-skill-server[18195]: INFO:snips_skill_server_lib::runner            : [meteo][err]   File "./action-meteo.py", line 201, in intent_received
Oct 15 14:03:02 snips-master snips-skill-server[18195]: INFO:snips_skill_server_lib::runner            : [meteo][err]     weather_forecast = get_weather_forecast(conf, slots)
Oct 15 14:03:02 snips-master snips-skill-server[18195]: INFO:snips_skill_server_lib::runner            : [meteo][err]   File "./action-meteo.py", line 96, in get_weather_forecast
Oct 15 14:03:02 snips-master snips-skill-server[18195]: INFO:snips_skill_server_lib::runner            : [meteo][err]     return parse_open_weather_map_forecast_response(r_forecast.json(), location, time, conf)
Oct 15 14:03:02 snips-master snips-skill-server[18195]: INFO:snips_skill_server_lib::runner            : [meteo][err]   File "./action-meteo.py", line 112, in parse_open_weather_map_forecast_response
Oct 15 14:03:02 snips-master snips-skill-server[18195]: INFO:snips_skill_server_lib::runner            : [meteo][err]     if isinstance(time, TimeIntervalValue):
Oct 15 14:03:02 snips-master snips-skill-server[18195]: INFO:snips_skill_server_lib::runner            : [meteo][err] NameError: global name 'TimeIntervalValue' is not defined
neofly commented 5 years ago

Bonjour, en ajoutant l'import suivant dans action-meteo.py from hermes_python.ontology.slot import * cela corrige le problème (en tout cas dans mon cas)