Skip to main content

Hivemind Websocket Client

Project description

Hivemind Websocket Client

logo

Install

pip install hivemind_bus_client

Usage

from time import sleep
from ovos_bus_client import Message
from hivemind_bus_client import HiveMessageBusClient
from hivemind_bus_client.decorators import on_escalate, \
    on_shared_bus, on_ping, on_broadcast, on_propagate, on_mycroft_message, \
    on_registry_opcode, on_third_party, on_cascade, on_handshake, on_hello, \
    on_rendezvous, on_hive_message, on_third_party, on_payload

key = "super_secret_access_key"
crypto_key = "ivf1NQSkQNogWYyr"

bus = HiveMessageBusClient(key, crypto_key=crypto_key, ssl=False)

bus.run_in_thread()


@on_mycroft_message(payload_type="speak", bus=bus)
def on_speak(msg):
    print(msg.data["utterance"])


mycroft_msg = Message("recognizer_loop:utterance",
                      {"utterances": ["tell me a joke"]})
bus.emit_mycroft(mycroft_msg)


sleep(50)

bus.close()

Cli Usage

$ hivemind-client --help
Usage: hivemind-client [OPTIONS] COMMAND [ARGS]...

Options:
  --help  Show this message and exit.

Commands:
  escalate      escalate a single mycroft message
  propagate     propagate a single mycroft message
  send-mycroft  send a single mycroft message
  terminal      simple cli interface to inject utterances and print speech


$ hivemind-client set-identity --help
Usage: hivemind-client set-identity [OPTIONS]

  persist node identity / credentials

Options:
  --key TEXT       HiveMind access key
  --password TEXT  HiveMind password
  --siteid TEXT    location identifier for message.context
  --help           Show this message and exit.


$ hivemind-client terminal --help
Usage: hivemind-client terminal [OPTIONS]

  simple cli interface to inject utterances and print speech

Options:
  --key TEXT      HiveMind access key
  --host TEXT     HiveMind host
  --port INTEGER  HiveMind port number
  --help          Show this message and exit.


$ hivemind-client send-mycroft --help
Usage: hivemind-client send-mycroft [OPTIONS]

  send a single mycroft message

Options:
  --key TEXT      HiveMind access key
  --host TEXT     HiveMind host
  --port INTEGER  HiveMind port number
  --msg TEXT      ovos message type to inject
  --payload TEXT  ovos message json payload
  --help          Show this message and exit.


$ hivemind-client escalate --help
Usage: hivemind-client escalate [OPTIONS]

  escalate a single mycroft message

Options:
  --key TEXT      HiveMind access key
  --host TEXT     HiveMind host
  --port INTEGER  HiveMind port number
  --msg TEXT      ovos message type to inject
  --payload TEXT  ovos message json payload
  --help          Show this message and exit.


$ hivemind-client propagate --help
Usage: hivemind-client propagate [OPTIONS]

  propagate a single mycroft message

Options:
  --key TEXT      HiveMind access key
  --host TEXT     HiveMind host
  --port INTEGER  HiveMind port number
  --msg TEXT      ovos message type to inject
  --payload TEXT  ovos message json payload
  --help          Show this message and exit.

Project details


Download files

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

Source Distribution

hivemind_bus_client-0.1.0a1.tar.gz (25.4 kB view details)

Uploaded Source

Built Distribution

hivemind_bus_client-0.1.0a1-py3-none-any.whl (27.7 kB view details)

Uploaded Python 3

File details

Details for the file hivemind_bus_client-0.1.0a1.tar.gz.

File metadata

  • Download URL: hivemind_bus_client-0.1.0a1.tar.gz
  • Upload date:
  • Size: 25.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.20

File hashes

Hashes for hivemind_bus_client-0.1.0a1.tar.gz
Algorithm Hash digest
SHA256 b0eaed32702cc8f39d8501bd0f90e34b8862c8176060ead8575539789cdd6966
MD5 003a1ad0409ce7da044c91b5ef4b476d
BLAKE2b-256 24b8ef6a1824e58ea8b897edf6ac955a0f98f3cc8fba98b9961af2c130397277

See more details on using hashes here.

File details

Details for the file hivemind_bus_client-0.1.0a1-py3-none-any.whl.

File metadata

File hashes

Hashes for hivemind_bus_client-0.1.0a1-py3-none-any.whl
Algorithm Hash digest
SHA256 79b76cb3a988df80a314862773c14924100050987418eaf1455119812c85766d
MD5 ac7e08a8ab7dce6676280451d609870d
BLAKE2b-256 d52eff78a26397400a113657b128412b0c77060c050a0b07207c6900ba7fccd5

See more details on using hashes here.

Supported by

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