From 4bfe619fa143efc2854e096f5d73e544818ba5f2 Mon Sep 17 00:00:00 2001 From: Daniel McKnight Date: Wed, 15 Nov 2023 16:25:41 -0800 Subject: [PATCH] Add log to diagnose duplicated Padatious intent handler calls Simplify language references in `handle_utterance` --- neon_core/skills/intent_service.py | 4 ++-- neon_core/skills/padatious_service.py | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/neon_core/skills/intent_service.py b/neon_core/skills/intent_service.py index 8d66c888d..de99a6d0d 100644 --- a/neon_core/skills/intent_service.py +++ b/neon_core/skills/intent_service.py @@ -239,8 +239,8 @@ def handle_utterance(self, message): self.bus.emit(reply) return - if lang.split('-')[0] in self.supported_languages: - LOG.debug(f'Native language support ({lang})') + if message.data["lang"].split('-')[0] in self.supported_languages: + LOG.debug(f'Native language support ({message.data["lang"]})') if message.context.get("translation_data") and \ message.context.get("translation_data")[0].get( "was_translated"): diff --git a/neon_core/skills/padatious_service.py b/neon_core/skills/padatious_service.py index 0c683c6dd..d3e17a741 100644 --- a/neon_core/skills/padatious_service.py +++ b/neon_core/skills/padatious_service.py @@ -34,6 +34,7 @@ def _match_level(self, utterances, limit, lang=None): self.conf = padatious_intent.conf self.has_result = True if self.conf and self.conf > limit: + LOG.debug(f"Matched intent {self.ret} for lang={lang}") return self.ret