Skip to main content

OVOS Messagebus Client

Project description

OpenVoiceOS Bus Client

This module is a simple interface for the OVOS messagebus and can be used to connect to OVOS, send messages and react to messages sent by the OpenVoiceOS system.


🤖 Persona Integration

The project also includes the ovos-solver-bus-plugin, a plugin for interacting with ovos-core wherever a solver can be used.

example persona.json

{
  "name": "Open Voice OS",
  "solvers": [
    "ovos-solver-bus-plugin",
    "ovos-solver-failure-plugin"
  ],
  "ovos-solver-bus-plugin": {
    "autoconnect": true,
    "host": "192.168.1.200",
    "port": 8181
  }
}

Use Cases:


📡 HiveMind Integration

This project includes native integration with HiveMind Plugin Manager, enabling seamless interoperability within the HiveMind ecosystem.

hivemind-ovos-agent-plugin is a hivemind Agent Protocol responsible for handling HiveMessages and translating them to the OpenVoiceOS messagebus


🐍 Python Usage

MycroftBusClient()

The MycroftBusClient() object can be setup to connect to any host and port as well as any endpont on that host. this makes it quite versitile and will work on the main bus as well as on a gui bus. If no arguments are provided it will try to connect to a local instance of OVOS on the default endpoint and port.

NOTE: we kept the original pre-fork class name for compatibility reasons

Message()

The Message object is a representation of the messagebus message, this will always contain a message type but can also contain data and context. Data is usually real information while the context typically contain information on where the message originated or who the intended recipient is.

Message('MESSAGE_TYPE', data={'meaning': 42}, context={'origin': 'A.Dent'})

Examples

Below are some a couple of simple cases for sending a message on the bus as well as reacting to messages on the bus

Sending a message on the bus.

from ovos_bus_client import MessageBusClient, Message

print('Setting up client to connect to a local OVOS instance')
client = MessageBusClient()
client.run_in_thread()

print('Sending speak message...')
client.emit(Message('speak', data={'utterance': 'Hello World'}))

Catching a message on the messagebus

from ovos_bus_client import MessageBusClient, Message

print('Setting up client to connect to a local OVOS instance')
client = MessageBusClient()

def print_utterance(message):
    print('OVOS said "{}"'.format(message.data.get('utterance')))


print('Registering handler for speak message...')
client.on('speak', print_utterance)

client.run_forever()

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ovos_bus_client-2.0.0a1.tar.gz (49.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ovos_bus_client-2.0.0a1-py3-none-any.whl (55.5 kB view details)

Uploaded Python 3

File details

Details for the file ovos_bus_client-2.0.0a1.tar.gz.

File metadata

  • Download URL: ovos_bus_client-2.0.0a1.tar.gz
  • Upload date:
  • Size: 49.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for ovos_bus_client-2.0.0a1.tar.gz
Algorithm Hash digest
SHA256 9b4938f3bafd8aa66897e0ef7f18d10ffd87621e274b4cd29f9626985c93d611
MD5 62bf7413f4f7f3257980bf726d1d6e32
BLAKE2b-256 5c0165ef49dd507d82be826d55fb9e32ba0e0ea13e9b19d7093ce78fd80a7da1

See more details on using hashes here.

File details

Details for the file ovos_bus_client-2.0.0a1-py3-none-any.whl.

File metadata

File hashes

Hashes for ovos_bus_client-2.0.0a1-py3-none-any.whl
Algorithm Hash digest
SHA256 32b31b0e2b9f8e5a857eaf5c480c3757a83097c5f5204149c68d22209ecabd1b
MD5 b1e5fbb11846bf928626a397bcbf6f7c
BLAKE2b-256 59bdd88079ca170977e0940085e1a2edda59c14c2f5c00118812d81ad7516658

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page