Adding a provider¶
To support another chat platform (Slack, Teams, …):
- Create
nimi_service/providers/<name>/with:- a client with the platform's auth, rate limits and retry policy (see
gchat/client.py: per-channel and per-project limiters, backoff on 429/5xx, posts not retried after a possible send); - rendering of payloads into readable
rendered_text(cards, attachments, mentions); - a
Providersubclass implementing every method inproviders/base.py.
- a client with the platform's auth, rate limits and retry policy (see
- Normalize carefully:
external_idmust be unique per provider and stable;- set
thread_external_id, andis_thread_replyfor replies; - map sender types to
bot/human(this decides what is ever analyzed); - normalize emoji so 👍 / 🤔 / 👎 match
reactions.VERDICTS(strip skin tones).
- Register it in
providers/__init__.py. - Add its credentials as settings in
config.py(plusenv.exampleand the settings reference). - Test normalization and rendering with real payloads (see the Google Chat tests in
tests/test_parse.py), then on a scratch database:.venv/bin/python -m nimi_service add-channel <name> <channel id> <label> --rca .venv/bin/python -m nimi_service ingest-once
Nothing else changes: the database, triage, the skill and the workflow are provider-neutral.