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.1.tar.gz (118.7 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.1-py3-none-any.whl (64.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: 3tears_channels-0.14.1.tar.gz
  • Upload date:
  • Size: 118.7 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.1.tar.gz
Algorithm Hash digest
SHA256 3139661d3037e5a187691377b513fe6c03be428a8f2200ad8aa98436ac9af53f
MD5 d997e336cf292ab7f5342ea04b07ec6d
BLAKE2b-256 3a2848860b1179041870140abdf256f94a3a79d1a623ed0f501392b70e75b97d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: 3tears_channels-0.14.1-py3-none-any.whl
  • Upload date:
  • Size: 64.8 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b84f3ce046d844a6c87d7717de13b1af194996ca36e49831b68cf9b7728b6dbe
MD5 cc642ed79b84ee04471f565cc7eeb74a
BLAKE2b-256 60b4efe1c3266d7319c3188c664e9b76bcc0c19330a304d4088d08159aaa7ba8

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