From bf79d0f43eb08510914b9e00507b7e9dc85a8093 Mon Sep 17 00:00:00 2001 From: Daniel McKnight Date: Mon, 13 Nov 2023 12:26:25 -0800 Subject: [PATCH] Fix context handling Annotate rationale for Message routing --- neon_speech/service.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/neon_speech/service.py b/neon_speech/service.py index c36dc5a..4d084d2 100644 --- a/neon_speech/service.py +++ b/neon_speech/service.py @@ -395,14 +395,18 @@ def build_context(msg: Message): _, parser_data, transcriptions = \ self._get_stt_from_file(wav_file_path, lang) message.context["audio_parser_data"] = parser_data + message.context.setdefault('timing', dict()) message.context['timing']['get_stt'] = self._stopwatch.time context = build_context(message) data = { "utterances": transcriptions, "lang": message.data.get("lang", "en-us") } + # Send a new message to the skills module with proper routing ctx handled = self._emit_utterance_to_skills(Message( 'recognizer_loop:utterance', data, context)) + + # Reply to original message with transcription/audio parser data self.bus.emit(message.reply(ident, data={"parser_data": parser_data, "transcripts": transcriptions,