Metadata-Version: 2.4
Name: kobil-chat
Version: 1.0.0
Summary: KOBIL Chat (Mercury) client for Python with automatic OAuth token management.
License: MIT
Project-URL: Repository, https://github.com/uveysservetoglu/kobil-sdks
Keywords: kobil,chat,mercury,messaging
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: kobil-core>=1.0

# kobil-chat

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

```bash
pip install kobil-chat
```

```python
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
