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.1a5) — 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
Cardonce 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 |
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
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 chat_sdk-0.0.1a5.tar.gz.
File metadata
- Download URL: chat_sdk-0.0.1a5.tar.gz
- Upload date:
- Size: 459.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ce514161530b6582d30d4bd4f52c2fe4438cf1005ee676d4bc764a374256d2cf
|
|
| MD5 |
e9980324c09b3c2bda0df3663f9aabb0
|
|
| BLAKE2b-256 |
03dd8c699d1cc8b435714a07dcc6eb1268b58a1f75d0436910a11cc1ba8f1a98
|
Provenance
The following attestation bundles were made for chat_sdk-0.0.1a5.tar.gz:
Publisher:
publish.yml on Chinchill-AI/chat-sdk-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
chat_sdk-0.0.1a5.tar.gz -
Subject digest:
ce514161530b6582d30d4bd4f52c2fe4438cf1005ee676d4bc764a374256d2cf - Sigstore transparency entry: 1245628194
- Sigstore integration time:
-
Permalink:
Chinchill-AI/chat-sdk-python@c393499a7661a1ea1d55e54b27d4d9deab5add52 -
Branch / Tag:
refs/tags/v0.0.1a5 - Owner: https://github.com/Chinchill-AI
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@c393499a7661a1ea1d55e54b27d4d9deab5add52 -
Trigger Event:
release
-
Statement type:
File details
Details for the file chat_sdk-0.0.1a5-py3-none-any.whl.
File metadata
- Download URL: chat_sdk-0.0.1a5-py3-none-any.whl
- Upload date:
- Size: 246.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d3bef24c00805b6c8fd9fbf0209dd71d3293ca7311e5678feed71076c557446d
|
|
| MD5 |
e988428ced8b909b86c1a618a101f895
|
|
| BLAKE2b-256 |
5de6e86489d18ab5bfde97ba2d8545071f8154a8f2bef51927f868c249fbff1f
|
Provenance
The following attestation bundles were made for chat_sdk-0.0.1a5-py3-none-any.whl:
Publisher:
publish.yml on Chinchill-AI/chat-sdk-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
chat_sdk-0.0.1a5-py3-none-any.whl -
Subject digest:
d3bef24c00805b6c8fd9fbf0209dd71d3293ca7311e5678feed71076c557446d - Sigstore transparency entry: 1245628201
- Sigstore integration time:
-
Permalink:
Chinchill-AI/chat-sdk-python@c393499a7661a1ea1d55e54b27d4d9deab5add52 -
Branch / Tag:
refs/tags/v0.0.1a5 - Owner: https://github.com/Chinchill-AI
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@c393499a7661a1ea1d55e54b27d4d9deab5add52 -
Trigger Event:
release
-
Statement type: