ovos-pydantic-models

July 31, 2026 · View on GitHub

Typed Pydantic v2 models for every message that flows over the OVOS MessageBus.

This package is the authoritative, machine-readable specification of the OVOS MessageBus protocol. Each message type is represented as a Pydantic model with validated fields, making it suitable for type-checking, serialization, documentation generation, and integration testing.

Installation

pip install ovos-pydantic-models

Usage

from ovos_pydantic_models import SpeakMessage, SpeakData

# Create a typed message
msg = SpeakMessage(data=SpeakData(utterance="Hello, world!", lang="en-us"))
print(msg.message_type)   # "speak"
print(msg.model_dump())   # {"message_type": "speak", "data": {...}, "context": {...}}

# Roundtrip from dict (e.g. received over the bus)
raw = {"message_type": "speak", "data": {"utterance": "Hello"}, "context": {}}
restored = SpeakMessage.model_validate(raw)
print(restored.data.utterance)   # "Hello"
from ovos_pydantic_models import RecognizerLoopUtteranceMessage, RecognizerLoopUtteranceData

msg = RecognizerLoopUtteranceMessage(
    data=RecognizerLoopUtteranceData(utterances=["play some jazz"], lang="en-us")
)
print(msg.message_type)   # "recognizer_loop:utterance"

Message Index

Messages are organized by subsystem:

Audio / TTS

Message typeClass
speakSpeakMessage
mycroft.audio.service.playAudioServicePlayMessage
mycroft.audio.service.pauseAudioServicePauseMessage
mycroft.audio.service.resumeAudioServiceResumeMessage
Message typeClass
mycroft.audio.service.stopAudioServiceStopMessage
mycroft.audio.queueMycroftAudioQueueMessage
ovos.languages.ttsOvosLanguagesTtsMessage
ovos.languages.tts.responseOvosLanguagesTtsResponseMessage

Listener / STT

Message typeClass
recognizer_loop:utteranceRecognizerLoopUtteranceMessage
recognizer_loop:wakewordRecognizerLoopWakeWordMessage
recognizer_loop:state.setRecognizerLoopStateSetMessage
recognizer_loop:state.getRecognizerLoopStateGetMessage
Message typeClass
recognizer_loop:state.get.responseRecognizerLoopStateResponseMessage
mycroft.mic.muteMycroftMicMuteMessage
mycroft.mic.listenMycroftMicListenMessage
ovos.languages.sttOvosLanguagesSttMessage
Message typeClass
ovos.languages.stt.responseOvosLanguagesSttResponseMessage
opm.ww.queryOpmWwQueryMessage

Intent Pipeline

Message typeClass
ovos.utterance.handledOvosUtteranceHandledMessage
ovos.utterance.cancelledOvosUtteranceCancelledMessage
complete_intent_failureCompleteIntentFailureMessage
add_contextAddContextMessage
Message typeClass
remove_contextRemoveContextMessage
clear_contextClearContextMessage
intent.service.skills.activateIntentServiceSkillsActivateMessage
intent.service.skills.deactivateIntentServiceSkillsDeactivateMessage
Message typeClass
skill.converse.pongSkillConversePongMessage
skill.converse.responseSkillConverseResponseMessage
ovos.skills.fallback.registerOvosSkillsFallbackRegisterMessage
ovos.skills.fallback.pingOvosSkillsFallbackPingMessage
Message typeClass
ovos.skills.fallback.pongOvosSkillsFallbackPongMessage
stop:globalStopGlobalMessage
stop:skillStopSkillMessage
mycroft.stopMycroftStopMessage
Message typeClass
mycroft.skills.abort_questionMycroftSkillsAbortQuestionMessage
mycroft.skills.abort_executionMycroftSkillsAbortExecutionMessage

Skill Manager / Core

Message typeClass
mycroft.readyMycroftReadyMessage
mycroft.skills.readyMycroftSkillsReadyMessage
mycroft.skills.is_readyMycroftSkillsIsReadyMessage
mycroft.skills.is_ready.responseMycroftSkillsIsReadyResponseMessage
Message typeClass
mycroft.skills.listMycroftSkillsListMessage
skillmanager.listSkillManagerListMessage
skillmanager.deactivateSkillManagerDeactivateMessage
mycroft.skills.errorMycroftSkillsErrorMessage
Message typeClass
skill.settings.changeSkillSettingsChangeMessage
ovos.skills.settings_changedOvosSkillsSettingsChangedMessage
ovos.skills.installOvosSkillsInstallMessage
ovos.skills.install.failedOvosSkillsInstallFailedMessage
Message typeClass
ovos.pip.installOvosPipInstallMessage
ovos.session.syncOvosSessionSyncMessage
ovos.session.update_defaultOvosSessionUpdateDefaultMessage

OCP (Common Play)

Message typeClass
ovos.common_play.queryOvosCommonPlayQueryMessage
ovos.common_play.query.responseOvosCommonPlayQueryResponseMessage
ovos.common_play.announceOvosCommonPlayAnnounceMessage
ovos.common_play.player.stateOvosCommonPlayPlayerStateMessage
Message typeClass
ovos.common_play.skills.detachOvosCommonPlaySkillsDetachMessage
ovos.common_play.register_keywordOvosCommonPlayRegisterKeywordMessage
ovos.common_play.skill.playOvosCommonPlaySkillPlayMessage

Common Query

Message typeClass
question:queryQuestionQueryMessage
question:query.responseQuestionQueryResponseMessage

GUI / Homescreen

Message typeClass
homescreen.manager.appHomescreenManagerAppMessage

Key Types

from ovos_pydantic_models import (
    # Base
    OpenVoiceOSMessage, MessageContext, Session,
    # Enums
    UtteranceState, ListeningState,
    MediaType, PlaybackType, PlayerState, MediaState, MatchConfidence,
    OcpMediaState,  # IntEnum 0-8 (Qt QMediaPlayer states)
    FallbackMode, ConverseMode, CQSMatchLevel,
    # Data models
    MediaEntry, Playlist, PluginStream,
)

Module Structure

ovos_pydantic_models/
  message.py          # OpenVoiceOSMessage base, MessageContext
  session.py          # Session, UtteranceState, IntentContextManager
  audio/
    playback.py       # Speak, AudioService messages
    ocp.py            # OcpMediaState (Qt IntEnum)
    opm.py            # OPM TTS query/response messages
  listener/
    recognizer_loop.py
    opm.py            # OPM STT/WW query messages
  intents/
    core.py           # context, utterance handled, intent get
    converse.py       # converse protocol (canonical)
    fallbacks.py      # fallback protocol (canonical)
    stop.py           # stop messages
  skills/
    ocp.py            # OCP enums, MediaEntry, query messages
    game.py           # game skill messages
    common_query.py   # question:query protocol
    converse.py       # re-exports from intents/converse.py
    fallback.py       # re-exports from intents/fallbacks.py
  core/
    skill_manager.py  # skill lifecycle messages
    skill_settings.py
    skill_installer.py
    session.py        # session sync messages
  gui/
    homescreen.py
  phal/
    connectivity.py
    volume.py

License

Apache 2.0. See LICENSE.


Credits

Developed by TigreGótico for OpenVoiceOS.

NGI0 Commons Fund

This project was funded through the NGI0 Commons Fund, a fund established by NLnet with financial support from the European Commission's Next Generation Internet programme, under the aegis of DG Communications Networks, Content and Technology under grant agreement No 101135429.