ioredis-style (pipeline-oriented) Redis state adapter for chat-py
Project description
chat-adapter-state-ioredis
ioredis-flavoured Redis state adapter for chat-py. Python port of upstream packages/state-ioredis.
Why this package exists
In Node.js, upstream ships two separate state packages — @chat-sdk/state-redis (wraps the modern redis / node-redis client) and @chat-sdk/state-ioredis (wraps the legacy ioredis client). Python has no such split: redis.asyncio is the canonical async client. So this package is a thin subclass of RedisStateAdapter — behaviour is identical; the only difference is the lock-token prefix (ioredis_ vs redis_), which matches upstream byte-for-byte so a single Redis instance can host mixed Python / TypeScript clients that inspect the token prefix.
Install
uv add chat-py-adapter-state-ioredis
Minimal example
from chat import Chat
from chat_adapter_state_ioredis import create_ioredis_state
from chat_adapter_slack import create_slack_adapter
bot = Chat(
user_name="mybot",
adapters={"slack": create_slack_adapter()},
state=create_ioredis_state(url="redis://localhost:6379"),
)
All other config (client injection, key prefix) is inherited from chat-adapter-state-redis — see that package's README.
Parity notes
- See
chat-adapter-state-redisfor the full implementation. The only override isacquire_lock, which emitsioredis_<ts>_<hex>tokens instead ofredis_<ts>_<hex>.
Test
uv run pytest packages/chat-adapter-state-ioredis
# Live — shares REDIS_URL with state-redis
REDIS_URL=redis://localhost:6379 uv run pytest packages/chat-integration-tests -k ioredis
Upstream
https://github.com/vercel/chat/tree/main/packages/state-ioredis
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 Distributions
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_py_adapter_state_ioredis-0.1.0-py3-none-any.whl.
File metadata
- Download URL: chat_py_adapter_state_ioredis-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.20 {"installer":{"name":"uv","version":"0.9.20","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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
749b5208eff190834e1fd494b5c9e076fbef49b45610ebed1f8f0d65e01a9fed
|
|
| MD5 |
06a9948569fbb0c2a1fdf24b72707c11
|
|
| BLAKE2b-256 |
bd3de4fa51cd3ab230219daa0239c04df0d0f5821eefc8635c73ae54c68a08d5
|