Skip to content

Commit

Permalink
Fix context handling
Browse files Browse the repository at this point in the history
Annotate rationale for Message routing
  • Loading branch information
NeonDaniel committed Nov 13, 2023
1 parent 7715c78 commit bf79d0f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions neon_speech/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit bf79d0f

Please sign in to comment.