OPM

OPM is the OVOS Plugin Manager, this base package provides arbitrary plugins to the ovos ecosystem

OPM plugins import their base classes from OPM making them portable and independent of core, plugins can be used in your standalone projects

By using OPM you can ensure a standard interface to plugins and easily make them configurable in your project, plugin code and example configurations are mapped to a string via python entrypoints in setup.py

Where to install plugins

Each kind of plugin should go into it's respective ovos service, most of the time ovos is sharing the base environment but in some setups such as ovos-docker you should keep in mind the correct locations to install each plugin

image

Each type of plugin has it's own dedicated documentation page, most of the time you only need to pip install ovos-plugin-name and edit mycroft.conf to configure and enable the plugin

HiveMind

HiveMind setups allow you to decide which plugins run server side or satellite side

In this example the hivemind server runs only core + skills, the satellites handle their own STT/TTS, this corresponds to the server profile in ovos-installer

image

In this example the hivemind server runs a full ovos-core, it handles STT/TTS for the satellites, this corresponds to the listener profile in ovos-installer

image

Plugin Packaging

Plugins need to define one entrypoint with their plugin type and plugin class

# OPM recognized plugin types
class PluginTypes(str, Enum):
    PHAL = "ovos.plugin.phal"
    ADMIN = "ovos.plugin.phal.admin"
    SKILL = "ovos.plugin.skill"
    VAD = "ovos.plugin.VAD"
    PHONEME = "ovos.plugin.g2p"
    AUDIO = 'mycroft.plugin.audioservice'
    STT = 'mycroft.plugin.stt'
    TTS = 'mycroft.plugin.tts'
    WAKEWORD = 'mycroft.plugin.wake_word'
    TRANSLATE = "neon.plugin.lang.translate"
    LANG_DETECT = "neon.plugin.lang.detect"
    UTTERANCE_TRANSFORMER = "neon.plugin.text"
    METADATA_TRANSFORMER = "neon.plugin.metadata"
    AUDIO_TRANSFORMER = "neon.plugin.audio"
    QUESTION_SOLVER = "neon.plugin.solver"
    COREFERENCE_SOLVER = "intentbox.coreference"
    KEYWORD_EXTRACTION = "intentbox.keywords"
    UTTERANCE_SEGMENTATION = "intentbox.segmentation"
    TOKENIZATION = "intentbox.tokenization"
    POSTAG = "intentbox.postag"

plugins can also optionally provide metadata about language support and sample configs via the {plugin_type}.config entrypoint

A typical setup.py for a plugin looks like this

from setuptools import setup

### replace this data with your plugin specific info
PLUGIN_TYPE = "mycroft.plugin.stt"  # see Enum above
PLUGIN_NAME = "ovos-stt-plugin-name"
PLUGIN_PKG = PLUGIN_NAME.replace("-", "_")
PLUGIN_CLAZZ = "MyPlugin"
PLUGIN_CONFIGS = "MyPluginConfig"
###

PLUGIN_ENTRY_POINT = f'{PLUGIN_NAME} = {PLUGIN_PKG}:{PLUGIN_CLAZZ}'
CONFIG_ENTRY_POINT = f'{PLUGIN_NAME}.config = {PLUGIN_PKG}:{PLUGIN_CONFIGS}'

# add version, author, license, description....
setup(
    name=PLUGIN_NAME,
    version='0.1.0',
    packages=[PLUGIN_PKG],
    install_requires=["speechrecognition>=3.8.1",
                      "ovos-plugin-manager>=0.0.1"],
    keywords='mycroft ovos plugin',
    entry_points={PLUGIN_TYPE: PLUGIN_ENTRY_POINT,
                  f'{PLUGIN_TYPE}.config': CONFIG_ENTRY_POINT}
)

Projects using OPM

OPM plugins are know to be natively supported by the following projects (non-exhaustive list)

Additionally, some plugins (AudioService, WakeWord, TTS and STT) are also backwards compatible with mycroft-core