Metadata-Version: 2.4
Name: chat-notifier
Version: 0.1.2
Summary: Google Chat notifier for MLflow and Ray jobs
Author: milan,vyom,neel
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: requests
Requires-Dist: mlflow

# Chat Notifier

Simple Python library to send Google Chat alerts for:

* MLflow best metric updates
* Ray training job status

## Installation

pip install chat-notifier

or for local development

pip install -e .

---

# MLflow Notifier Usage

Used to notify when a new best metric is achieved in MLflow.

import mlflow
from notifier import MLflowNotifier

notifier = MLflowNotifier()

with mlflow.start_run() as run:

```
mlflow.log_metric("mAP50", 0.91)

notifier.check_new_best(
    experiment_name="ppe-detection",
    run_id=run.info.run_id
)
```

Required environment variables:

MLFLOW_TRACKING_URI=http://localhost:5000
GOOGLE_CHAT_WEBHOOK_URL=your_google_chat_webhook
METRIC_NAME=mAP50
METRIC_MODE=max

---

# Ray Job Notifier Usage

Used to notify training success or failure.

from notifier import RayJobNotifier
from datetime import datetime

notifier = RayJobNotifier()

start_time = datetime.utcnow()

status = 0
logs = ""

end_time = datetime.utcnow()

notifier.send_notification(
status=status,
logs=logs,
start_time=start_time,
end_time=end_time
)

Required environment variables:

GOOGLE_CHAT_RAY_WEBHOOK_URL=your_google_chat_webhook
SERVER=gpu-server
MODEL_NAME=my-model
