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.2
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.2.tar.gz (57.4 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.2-py3-none-any.whl (56.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: stapel_chat-0.2.2.tar.gz
  • Upload date:
  • Size: 57.4 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.2.tar.gz
Algorithm Hash digest
SHA256 853461d1537e1b3cc53a02e19ed1f4049ac69394dcb01e2d6b38af3ce59a4096
MD5 5ac874a9fa4d2d5111f2a5f143ce9b1e
BLAKE2b-256 4fe08de776e3cdc4da8a360e4a0c17f9df8ebd7f785c8c2a40e3c379affdf4e5

See more details on using hashes here.

Provenance

The following attestation bundles were made for stapel_chat-0.2.2.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.2-py3-none-any.whl.

File metadata

  • Download URL: stapel_chat-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 56.5 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8d9723ac6f04f9bcb35850fcda175468fa9da300bd853bc1edab82ed3bb4e65d
MD5 3bec665ab6267d204066f73cbb1a9c19
BLAKE2b-256 8eb200a1b1472a8978b4946b490ee19c01ae0b8303c7a8fdf3f728bfe69afa9f

See more details on using hashes here.

Provenance

The following attestation bundles were made for stapel_chat-0.2.2-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

This release

0.2.2 This release

2 files

0.2.1

2 files

0.2.0

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