Skip to content

Commit

Permalink
Add log to diagnose duplicated Padatious intent handler calls
Browse files Browse the repository at this point in the history
Simplify language references in `handle_utterance`
  • Loading branch information
NeonDaniel committed Nov 16, 2023
1 parent 127ce30 commit 4bfe619
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions neon_core/skills/intent_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"):
Expand Down
1 change: 1 addition & 0 deletions neon_core/skills/padatious_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down

0 comments on commit 4bfe619

Please sign in to comment.