CMSDK 2.0.1
Cross-platform C++ base library and SDK for the Psyclone AIOS platform
Loading...
Searching...
No Matches
psyclone_client Namespace Reference

Namespaces

namespace  client
namespace  datamessage
namespace  http
namespace  remote_module
namespace  stats
namespace  transports

Detailed Description

Psyclone client for Python: talk to a running Psyclone system from outside it.

Post messages into the system by **post name** and receive what its triggers send out by **trigger
name**, over UDP, TCP or WebSocket, with CMSDK DataMessages (byte-identical to the C++ library, in the
full or the packed form). Pure Python, standard library only; Python 3.8+ on any OS.

    from psyclone_client import PsycloneClient, DataMessage

    with PsycloneClient.websocket("ws://host:18600/phone", device="py-1") as psy:
        psy.on_trigger("Playout", lambda m: print(m.get_string("Text")))
        psy.post("AudioFrame", DataMessage().set_data("audio", b"..."))
        reply = psy.request("Question", DataMessage().set_string("Text", "hi"), timeout=3)