Skip to main content

stapel-chat

CI coverage pypi downloads python license llms.txt

Conversations and messaging: direct (1:1, idempotent by participant pair), group and support threads on one model; text/system messages with a monotonic per-conversation seq, replies and opaque CDN attachment keys; per-participant read markers and unread counts; anchor-paginated history (canonical anchor=seq) and conversation lists; a support layer (unassigned queue, first-come assignment, open/pending/resolved with reopen); and an optional Channels consumer for realtime delivery with seq-replay resume.

Part of the Stapel framework — composable Django apps that deploy as a monolith or as microservices without changing module code.

Install

pip install stapel-chat

At a glance

Fact Value
Version 0.2.0
Python >=3.11 (3.11, 3.12, 3.13, 3.14)
HTTP operations 10
Config axes 3
Usage surface 11
Extension points 4
Error codes 54
Fleet dependencies stapel-auth (optional) · stapel-cdn (optional) · stapel-core

Documentation

OpenAPI · capabilities.json · llms.txt (for agents)

One model backs three kinds of thread: direct (1:1, idempotent by participant pair), group, and support (a customer↔operator thread with a queue and assignment lifecycle). Messages carry a monotonic per-conversation seq that is the canonical anchor for history pagination and the resume cursor for realtime — so nothing depends on a socket staying up.

Quick start

INSTALLED_APPS = [
    # ...
    "stapel_core.django.apps.CommonDjangoConfig",
    "stapel_core.django.users",
    "rest_framework",
    "stapel_chat",
]

# urls.py
urlpatterns = [
    path("chat/", include("stapel_chat.urls")),
]

What you get

  • ConversationsPOST /chat/api/conversations (direct / group / support); direct is get-or-create by participant pair. GET lists your conversations (anchor-paginated) with unread_count.

  • MessagesGET/POST /chat/api/conversations/{id}/messages. History is anchored on seq (newest-first, both directions). Sending allocates the next seq and emits chat.message in one transaction.

  • Read markersPOST /chat/api/conversations/{id}/read (upto_seq).

  • SupportGET /chat/api/support/queue, POST .../support/conversations/{id}/{assign,resolve,reopen}.

  • Realtime (optional)stapel_chat.consumers.ChatConsumer over Channels: hello{last_seq} → replay by seq → live delivery. Install the extra:

    pip install 'stapel-chat[channels]'
    

    and wire it behind stapel_core.django.jwt.channels.JWTAuthMiddlewareStack in your asgi.py.

Configuration (STAPEL_CHAT)

Key Default Meaning
CHAT_KINDS ["direct","group","support"] Enabled thread kinds (drop support to disable the operator queue)
ATTACHMENTS True Allow opaque attachment keys on messages
MAX_BODY_LENGTH 4000 Hard cap on a text body
SCOPE_PROVIDER stapel_chat.scope.DefaultScopeProvider Resolve/enforce the opaque scope_key (e.g. per workspace)

See MODULE.md for the extension seams, comm surface and anti-patterns.

License

MIT — see LICENSE.


This page is assembled by stapel-readme from docs/readme.md plus the contract artifacts in docs/. Edit the prose in docs/readme.md; the badges, facts and links above and below it are generated — do not hand-edit README.md.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

stapel_chat-0.2.0.tar.gz (54.6 kB view details)

Uploaded Source

Built Distribution

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

stapel_chat-0.2.0-py3-none-any.whl (54.8 kB view details)

Uploaded Python 3

File details

Details for the file stapel_chat-0.2.0.tar.gz.

File metadata

  • Download URL: stapel_chat-0.2.0.tar.gz
  • Upload date:
  • Size: 54.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for stapel_chat-0.2.0.tar.gz
Algorithm Hash digest
SHA256 85ebd4803cdb320cbfa56a12621ff5d22265e1cf6067829324094322d99f9371
MD5 93446d698c97e2b82ecf057885819e36
BLAKE2b-256 20862733ed29f4f4d1f843b4ac7ad11a98175a3130d62c216f77fc06ffc1ff93

See more details on using hashes here.

Provenance

The following attestation bundles were made for stapel_chat-0.2.0.tar.gz:

Publisher: publish.yml on usestapel/stapel-chat

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

File details

Details for the file stapel_chat-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: stapel_chat-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 54.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for stapel_chat-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b9c3f3445f5777ae3d3189f1aa338f97b73d5504d6ec63740c60c3fe4fae19f4
MD5 eb50f48484059d6aae4f83dd6aabb3f9
BLAKE2b-256 53262e841a6ca709e1d214c4eee1c9404832c839f5380ae2c773894f76860e90

See more details on using hashes here.

Provenance

The following attestation bundles were made for stapel_chat-0.2.0-py3-none-any.whl:

Publisher: publish.yml on usestapel/stapel-chat

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

Release history Release notifications | RSS feed

0.10.0

2 files

0.9.3

2 files

0.9.2

2 files

0.9.1

2 files

0.9.0

2 files

0.8.6

2 files

0.8.5

2 files

0.8.4

2 files

0.8.3

2 files

0.8.2

2 files

0.8.1

2 files

0.8.0

2 files

0.7.4

2 files

0.7.3

2 files

0.7.2

2 files

0.7.0

2 files

0.6.3

2 files

0.6.2

2 files

0.6.1

2 files

0.6.0

2 files

0.5.1

2 files

0.4.0

2 files

0.3.1

2 files

0.2.3

2 files

0.2.2

2 files

0.2.1

2 files

This release

0.2.0 This release

2 files

0.1.9

2 files

0.1.8

2 files

0.1.7

2 files

0.1.6

2 files

0.1.3

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page