WebSocket JSON-RPC multiplexer transport for Swarmauri agents.
Project description
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
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file swarmauri_transport_wsjsonrpcmux-0.1.1.dev21.tar.gz.
File metadata
- Download URL: swarmauri_transport_wsjsonrpcmux-0.1.1.dev21.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6fb1eed5bd7b49ebca2b63c34b9483f7d5c4c13085a741aa29be8a2ba3b112cf
|
|
| MD5 |
aad2d2772a12a39e7721e846fc85f71f
|
|
| BLAKE2b-256 |
1759cb91ec129b56d974204d5651f0db74e0bbc7be47cfcf6a50b1bd653fc872
|
File details
Details for the file swarmauri_transport_wsjsonrpcmux-0.1.1.dev21-py3-none-any.whl.
File metadata
- Download URL: swarmauri_transport_wsjsonrpcmux-0.1.1.dev21-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
947fd8ca6ffb13ede8e994e33efe7cc66c550384a5efd81dccf95c44166c55f5
|
|
| MD5 |
b7030adfbf5221d223daaebc34d77a17
|
|
| BLAKE2b-256 |
63201c90605ea444fbafe295213dba8a08a16be4caf397d76b3dc88145418003
|