Skip to main content

kobil-chat

KOBIL Chat (Mercury) client for Python, with automatic OAuth token management.

pip install kobil-chat
from kobil.chat import ChatClient

chat = ChatClient(
    chat_base_url="https://idp.cloud.kobil.com/auth/realms/{TENANT}/mpower/v1/users/{USER_ID}",
    tenant_name="acme",
    token_auth_mode="basic",  # chat token endpoint may require Basic auth
    media_download_url="https://idp.cloud.kobil.com/v1/mpower/tenants/{TENANT}/media/{MEDIA_ID}/download",
    # credentials optional if KOBIL_* env vars are set
)

chat.send_text(user_id, "Hi!", title="Update")
chat.send_choice(user_id, "Continue?", ["Yes", "No"])
chat.send_smart_screen(user_id, "Opening…", "service_client_id")
chat.send_attachment(user_id, open("a.pdf", "rb").read(), file_name="a.pdf", text="Please review")
data = chat.get_attachment_file(media_id)  # bytes

{TENANT} is filled from tenant_name, {USER_ID} from the call, {MEDIA_ID} from get_attachment_file. Send operations return {"messageId": ..., "instanceId": ...}. Failures raise kobil.chat.KobilChatError.

License

MIT

Metadata

Release files for kobil-chat 1.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for kobil-chat 1.2.0
File Size Uploaded Provenance Actions
kobil_chat-1.2.0.tar.gz 3.8 kB Without provenance Details for kobil_chat-1.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for kobil-chat 1.2.0
File Interpreter ABI Platform Actions
kobil_chat-1.2.0-py3-none-any.whl Python 3 none any Details for kobil_chat-1.2.0-py3-none-any.whl

Total release size: 7.8 kB

Release files / kobil_chat-1.2.0.tar.gz

Download URL kobil_chat-1.2.0.tar.gz
Size 3.8 kB
Tags Source
SHA-256 checksum
How to use checksums
1fe517d57e9be83cc324d637ffae625bf768f7067cf1b2cf4fe7b5990c168d4b
BLAKE2b-256 checksum
How to use checksums
a14ac7b11b61cc741722f2f3fd32c275974acba750b47d2e068f4b350a933bba
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16

Release files / kobil_chat-1.2.0-py3-none-any.whl

Download URL kobil_chat-1.2.0-py3-none-any.whl
Size 4.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a432a68d5c2fa092b0da8d4c1dacec0166f13d6b5eda53a928d33972d6daff19
BLAKE2b-256 checksum
How to use checksums
58f81dd0f5765deef1fdf1db5ad4965a032b3fe872f046336a35aa6bef5f551d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16

Security for kobil-chat 1.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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