Skip to main content

Unified message protocol for channel adapters in the 3tears platform

Project description

3tears-channels

A unified message protocol for the 3tears framework, with adapters for Slack, Discord, and WebSocket clients. Write your agent logic once and deliver it across channels.

pip install 3tears-channels

What you get

  • One message model -- ChannelMessage, ChannelResponse, ChannelDeliveryMessage, and Attachment carry a request and its reply regardless of channel.
  • Routing -- ChannelRouter and StreamingChannelRouter dispatch inbound messages and stream responses back.
  • Slack and Discord -- payload and rich-formatting builders (build_slack_blocks, build_slack_payload, build_discord_embed, build_discord_payload) plus a should_use_rich_formatting helper.
  • WebSocket -- WebSocketHandler, WebSocketProtocol, a ConnectionRegistry, and frame primitives for real-time clients.
  • Rooms and presence -- RoomFanout, RoomState, RoomIndexCollection, and a three-tier-backed PresenceCollection with a PresenceSweeper for connection liveness.

Quickstart

from threetears.channels import ChannelRouter, ChannelMessage, build_slack_blocks

router = ChannelRouter(...)
response = await router.dispatch(ChannelMessage(text="hello", channel="slack", ...))

blocks = build_slack_blocks(response)

License

MIT. See LICENSE.

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

3tears_channels-0.14.0.tar.gz (116.9 kB view details)

Uploaded Source

Built Distribution

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

3tears_channels-0.14.0-py3-none-any.whl (63.6 kB view details)

Uploaded Python 3

File details

Details for the file 3tears_channels-0.14.0.tar.gz.

File metadata

  • Download URL: 3tears_channels-0.14.0.tar.gz
  • Upload date:
  • Size: 116.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.1 {"installer":{"name":"uv","version":"0.11.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for 3tears_channels-0.14.0.tar.gz
Algorithm Hash digest
SHA256 fcf26213753b8b5b4b4b173cba2c3276507c61e047e262d1193070b3ab93ed6d
MD5 ab611fe434f8aac26dba9241e183572b
BLAKE2b-256 c7e784b7fa149a29a19a75e4436bd665845e5d5e274e020c8eb429e94a6709e3

See more details on using hashes here.

File details

Details for the file 3tears_channels-0.14.0-py3-none-any.whl.

File metadata

  • Download URL: 3tears_channels-0.14.0-py3-none-any.whl
  • Upload date:
  • Size: 63.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.1 {"installer":{"name":"uv","version":"0.11.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for 3tears_channels-0.14.0-py3-none-any.whl
Algorithm Hash digest
SHA256 58a3d070ddfe30f854ceda67cff21476d6df0049846d8d59ded6efb91bbf9bd1
MD5 5a20f4feba184bde6a6379de163f8e92
BLAKE2b-256 b299603620a3afabd75e1542867b86fe590bd4853d52d7c94fc49f78f92f0e1f

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