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.16.1.tar.gz (120.4 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.16.1-py3-none-any.whl (66.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: 3tears_channels-0.16.1.tar.gz
  • Upload date:
  • Size: 120.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for 3tears_channels-0.16.1.tar.gz
Algorithm Hash digest
SHA256 c003236a4c67481aba7daa9c8ac7f534a3057ef7e8166d777a41b9ddcac75bb7
MD5 0184345aa9d1e09d85d8ececa41f5e63
BLAKE2b-256 14c96a4c53d413805e7d1beb1f2290e063ef6406ff7ad5c2010fea6e72e8926c

See more details on using hashes here.

Provenance

The following attestation bundles were made for 3tears_channels-0.16.1.tar.gz:

Publisher: release.yml on pacepace/3tears

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

File hashes

Hashes for 3tears_channels-0.16.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9c9af92e9631880dbf18582aadda5bf95ca62e0a42b829f1f3ebbb834e0e9f94
MD5 a671302fa3305b074a1be5c4830438d7
BLAKE2b-256 f9413db204e22f7fc25ed58f8722a36d6a3766a5bdb849f15f6914d468651ba2

See more details on using hashes here.

Provenance

The following attestation bundles were made for 3tears_channels-0.16.1-py3-none-any.whl:

Publisher: release.yml on pacepace/3tears

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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