Skip to content
 
 

Repository files navigation

ovos-utterance-plugin-cancel

PyPI License

This is an OpenVoiceOS utterance transformer plugin. It cancels an utterance when the user says a cancel or "nevermind" phrase at the end.

Example: for the phrase "Hey Mycroft, can you tell me the weather in… ugh, nevermind that", the plugin drops the utterance, and no skill fires.

Installation

pip install ovos-utterance-plugin-cancel

How it works

The plugin runs before skill matching. It checks whether the end of the utterance matches any phrase from locale/<lang>/cancel.intent. On a match, it returns an empty utterance list with context {"canceled": True, "cancel_word": "<phrase>"}.

The plugin selects the language automatically with langcodes.closest_match. Phrases support bracket-expansion syntax, for example cancel (it|that).

Supported languages

ca-ES · da-DK · de-DE · en-US · es-ES · fr-FR · gl-ES · it-IT · nl-NL · pt-BR · pt-PT

To add a language, create ovos_utterance_plugin_cancel/locale/<lang>/cancel.intent with one phrase per line.

Configuration

This plugin is enabled by default in ovos-config alongside the other standard utterance transformers:

"utterance_transformers": {
    "ovos-utterance-normalizer": {},
    "ovos-utterance-plugin-cancel": {},
    "ovos-utterance-corrections-plugin": {}
}

To disable it, add "enable": false to your config:

"utterance_transformers": {
    "ovos-utterance-plugin-cancel": {"enable": false}
}

Development

git clone https://github.com/OpenVoiceOS/ovos-utterance-plugin-cancel
cd ovos-utterance-plugin-cancel
uv pip install -e ".[dev]"
uv run pytest test/ -v --cov=ovos_utterance_plugin_cancel

Related projects

Credits

About

No description or website provided.

Topics

Resources

Contributing

Stars

0 stars

Watchers

1 watching

Forks

Releases

Sponsor this project

Packages

Used by

Contributors

Languages