Skip to main content

Multi-platform async chat SDK for Python — port of Vercel Chat

Project description

chat-sdk-python

Multi-platform async chat SDK for Python. Port of Vercel Chat.

Status: Alpha (0.0.1a7) — API may change. Not yet tested in production.

Why chat-sdk?

  • Write once, deploy to 8 platforms. One handler runs on Slack, Discord, Teams, Telegram, WhatsApp, Google Chat, GitHub, and Linear.
  • Built-in concurrency primitives. Deduplication, thread locking, and message queuing are handled for you.
  • Cross-platform cards. Author a Card once and it renders as Block Kit (Slack), Adaptive Cards (Teams), embeds (Discord), and more.
  • Not a replacement for platform SDKs. chat-sdk is built on top of them. You can always drop down to the native SDK when you need to.

Install

pip install chat-sdk                   # core only
pip install chat-sdk[slack]            # + Slack adapter
pip install chat-sdk[all]              # all adapters + state backends

Quick Start

from chat_sdk import Chat, Card, Button, Actions, MemoryStateAdapter
from chat_sdk.adapters.slack import create_slack_adapter

chat = Chat(
    adapters={"slack": create_slack_adapter()},
    state=MemoryStateAdapter(),
    user_name="my-bot",
)

@chat.on_mention
async def handle_mention(thread, message):
    await thread.post(
        Card(title="Hello!", children=[
            Actions([Button(id="hi", label="Say Hi")])
        ])
    )

Adapters

Platform Install Extra Status
Slack chat-sdk[slack] Alpha
Discord chat-sdk[discord] Alpha
Teams chat-sdk[teams] Alpha
Telegram chat-sdk[telegram] Alpha
WhatsApp chat-sdk[whatsapp] Alpha
Google Chat chat-sdk[google-chat] Alpha
GitHub chat-sdk[github] Alpha
Linear chat-sdk[linear] Alpha

State Backends

Backend Install Extra
In-Memory Built-in
Redis chat-sdk[redis]
PostgreSQL chat-sdk[postgres]

Compared to Alternatives

Feature chat-sdk Raw platform SDKs BotFramework SDK
Multi-platform from one codebase 8 platforms 1 per SDK Teams + limited
Async-native (Python 3.11+) Yes Varies No
Cross-platform cards Card model Platform-specific Adaptive Cards only
Thread locking / dedup Built-in DIY DIY
State abstraction (mem/redis/pg) Built-in DIY DIY
Drop down to native SDK Yes N/A Partially

Documentation

Document Description
Architecture Module dependency graph, adapter protocol, card system, concurrency strategies, state backends, markdown pipeline, streaming pipeline
Upstream Sync How to keep the Python port in sync with the Vercel Chat TS SDK, translation patterns, known footguns
Security Webhook verification per platform, SSRF protections, crypto details, known limitations, production audit checklist
Testing Test categories, how to run tests, how to add adapter tests, coverage gaps, dispatch key validation
Design Decisions Rationale for key architectural choices (hand-rolled parser, PascalCase builders, global singleton, zero deps)
Contributing Dev setup, code quality, PR expectations
Changelog Release history

Development

uv sync --group dev
uv run pytest tests/
uv run ruff check src/

License

MIT

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

chat_sdk-0.0.1a7.tar.gz (499.2 kB view details)

Uploaded Source

Built Distribution

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

chat_sdk-0.0.1a7-py3-none-any.whl (247.3 kB view details)

Uploaded Python 3

File details

Details for the file chat_sdk-0.0.1a7.tar.gz.

File metadata

  • Download URL: chat_sdk-0.0.1a7.tar.gz
  • Upload date:
  • Size: 499.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for chat_sdk-0.0.1a7.tar.gz
Algorithm Hash digest
SHA256 28330599102ec0cb9a5a6c9df5a0ef5a79699fc4d5696abb54d7f54c5e387a58
MD5 4060a1e4de1b7b39a9a646a7f9a6df44
BLAKE2b-256 4fa39da784125135443acc498d9f34ff177f2ae96723c45794b22553c7bdc1b4

See more details on using hashes here.

Provenance

The following attestation bundles were made for chat_sdk-0.0.1a7.tar.gz:

Publisher: publish.yml on Chinchill-AI/chat-sdk-python

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

File details

Details for the file chat_sdk-0.0.1a7-py3-none-any.whl.

File metadata

  • Download URL: chat_sdk-0.0.1a7-py3-none-any.whl
  • Upload date:
  • Size: 247.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for chat_sdk-0.0.1a7-py3-none-any.whl
Algorithm Hash digest
SHA256 c29d4064f02143d8ae1519be3d8e375b14d4f6a251c64c18b38c6ac6b55aaad3
MD5 5188effb9be87bce89944c6670666fc7
BLAKE2b-256 85bcf9f7e40d8d647c4feed7b1855687842c606ad17b2fffcd0046686473fe90

See more details on using hashes here.

Provenance

The following attestation bundles were made for chat_sdk-0.0.1a7-py3-none-any.whl:

Publisher: publish.yml on Chinchill-AI/chat-sdk-python

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