Skip to main content

WebSocket JSON-RPC multiplexer transport for Swarmauri agents.

Project description

Swarmauri Logo

PyPI - Downloads Hits PyPI - Python Version PyPI - License PyPI - swarmauri_transport_wsjsonrpcmux Discord

Swarmauri Transport ? WebSocket JSON-RPC

swarmauri-transport-wsjsonrpcmux provides a JSON-RPC 2.0 dispatcher over WebSockets for browser-friendly agent communication.

Installation

Using uv

uv pip install swarmauri-transport-wsjsonrpcmux --index-url https://pypi.org/simple

Using pip

pip install swarmauri-transport-wsjsonrpcmux

Usage

import asyncio
from swarmauri_transport_wsjsonrpcmux import WsJsonrpcMuxTransport

async def handler(method: str, params):
    if method == "echo":
        return params
    raise ValueError("unknown method")

async def main() -> None:
    transport = WsJsonrpcMuxTransport()
    transport.set_rpc_handler(handler)
    async with transport.server(host="127.0.0.1", port=8765):
        await asyncio.sleep(1)

asyncio.run(main())

Pair the server with a client created via WsJsonrpcMuxTransport().client(...) and call(...) to complete the RPC loop.

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

Built Distribution

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

File details

Details for the file swarmauri_transport_wsjsonrpcmux-0.11.0.dev1.tar.gz.

File metadata

  • Download URL: swarmauri_transport_wsjsonrpcmux-0.11.0.dev1.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for swarmauri_transport_wsjsonrpcmux-0.11.0.dev1.tar.gz
Algorithm Hash digest
SHA256 74831310d77f6c3123cd86422f82477d1eedf303b5ffb4558445650e9612dda8
MD5 6094ebc83c5d3efeb9664097e5e03d12
BLAKE2b-256 326b0d7f1455b2f7af6194a8dcda6daf7b489c0ebc0bb53c8e3282cb4af54217

See more details on using hashes here.

File details

Details for the file swarmauri_transport_wsjsonrpcmux-0.11.0.dev1-py3-none-any.whl.

File metadata

  • Download URL: swarmauri_transport_wsjsonrpcmux-0.11.0.dev1-py3-none-any.whl
  • Upload date:
  • Size: 4.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for swarmauri_transport_wsjsonrpcmux-0.11.0.dev1-py3-none-any.whl
Algorithm Hash digest
SHA256 81f4bac071b40bd5e9d62400999b1ec4e1bdbd6891871e96c476bf45299b81e1
MD5 5eda5da677cdc566dd20b410fe7ecff2
BLAKE2b-256 86990db9b37bf946c294bd8e4ab08314aa24b0dac328da487e0d1eb735ba3909

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