ovos-core icon indicating copy to clipboard operation
ovos-core copied to clipboard

feat/ovos.utterance.handled

Open JarbasAl opened this issue 1 year ago • 0 comments

emit a bus message when utterance is handled to unambigously identify when handling was completed. "ovos.utterance.handled"

allows clients such as hivemind to know when to stop expecting more "speak" events

a concrete example from https://github.com/JarbasHiveMind/ovos-solver-hivemind-plugin

        # NOTE: this message not yet introduced in ovos-core
        self.hm.on_mycroft("ovos.utterance.handled", self._end_of_response)

        ##############
        # HACK - waiting for https://github.com/OpenVoiceOS/ovos-core/pull/478
        # TODO - new bus message in ovos-core
        #  to unambiguosly identify end of utterance parsing
        #  currently these are 4 possible outcomes for any request
        #  does not account for OCP pipeline requests
        self.hm.on_mycroft("ovos.utterance.cancelled",
                           self._end_of_response)
        self.hm.on_mycroft("complete_intent_failure",
                           self._end_of_response)
        self.hm.on_mycroft("mycroft.skill.handler.complete",
                           self._end_of_response)
        self.hm.on_mycroft( "skill.converse.response",  # need to check if result is True
                           self._end_of_response)

also implements TODO for cancel sound, sound does not exist and does not play by default, but can be added by a user

if in docker sound needs to be available to ovos-audio container

JarbasAl avatar May 21 '24 17:05 JarbasAl