From b62612380aa7ad2a3c4c32a6607958a414e17cb0 Mon Sep 17 00:00:00 2001 From: Daniel McKnight <34697904+NeonDaniel@users.noreply.github.com> Date: Thu, 9 May 2024 18:52:46 -0700 Subject: [PATCH] Fix ovos-core 0.0.8 Common Query compat. (#523) * Troubleshooting ovos-core 0.0.8 CommonQuery compat. * Troubleshooting ovos-core 0.0.8 CommonQuery compat. * Cleanup changes to match upstream ovos-workshop --------- Co-authored-by: Daniel McKnight --- neon_utils/skills/common_query_skill.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/neon_utils/skills/common_query_skill.py b/neon_utils/skills/common_query_skill.py index d51c6fe5..5aa97725 100644 --- a/neon_utils/skills/common_query_skill.py +++ b/neon_utils/skills/common_query_skill.py @@ -65,7 +65,6 @@ def handles_visuals(platform): return platform in VISUAL_DEVICES -# TODO: Consider deprecation and implementing ovos_workshop directly class CommonQuerySkill(NeonSkill, _CQS): """Question answering skills should be based on this class. @@ -168,6 +167,8 @@ def __handle_query_action(self, message): data = message.data.get("callback_data") or {} if data.get("answer"): self.speak(data["answer"]) + else: + LOG.error(f"no answer provided in: {message.data.keys()}") # Invoke derived class to provide playback data self.CQS_action(phrase, data) self.bus.emit(message.forward("mycroft.skill.handler.complete", @@ -191,6 +192,7 @@ def __handle_question_query(self, message): level = result[1] answer = result[2] callback = result[3] if len(result) > 3 else None + callback["answer"] = answer confidence = self.__calc_confidence(match, search_phrase, level) self.bus.emit(message.response({"phrase": search_phrase, "skill_id": self.skill_id,