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


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.1.1.dev23.tar.gz.

File metadata

  • Download URL: swarmauri_transport_wsjsonrpcmux-0.1.1.dev23.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.12 {"installer":{"name":"uv","version":"0.10.12","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.1.1.dev23.tar.gz
Algorithm Hash digest
SHA256 134712d40b3f107b153dff283a8db2d2017a12d400ead8b8fc6a55c6d596a3fc
MD5 4c73fbd9899791cb8b8ae37c9e9a09d9
BLAKE2b-256 cf232a499fd8c53cf0237d27b38606dc3d60f16ff7fc2fffc99b49e658ca0b15

See more details on using hashes here.

File details

Details for the file swarmauri_transport_wsjsonrpcmux-0.1.1.dev23-py3-none-any.whl.

File metadata

  • Download URL: swarmauri_transport_wsjsonrpcmux-0.1.1.dev23-py3-none-any.whl
  • Upload date:
  • Size: 4.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.12 {"installer":{"name":"uv","version":"0.10.12","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.1.1.dev23-py3-none-any.whl
Algorithm Hash digest
SHA256 c9f58331f439194a558499efd116715e3d58700f98ecc097bcafbc837bc43c79
MD5 c97f42284dfd73b8d09fdddbb06de2e9
BLAKE2b-256 f9bae799e3fe15f905fe32f4c6ef2a5330e7ea3094e00996ae2fc2f8a00f8068

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