Scriptable alerts triggered from Python, sent to you via Slack or email

Send a Slack or email alert, triggered from your Python script.

  1. Check your Slack or email to see the scriptable alerts.


wandb.alert(title="Low Acc", text="Accuracy is below the expected threshold")

  • title (string): A short description of the alert, for example "Low accuracy"

  • text (string): A longer, more detailed description of what happened to trigger the alert

  • level (optional): How important the alert is — must be either INFO, WARN, or ERROR

  • wait_duration (optional): How many seconds to wait before sending another alert with the same title. This helps reduce alert spam.


This simple alert sends a warning when accuracy falls below a threshold. To avoid spam, it only sends alerts at least 5 minutes apart.

Run the code →

from datetime import timedelta
import wandb
from wandb import AlertLevel
if acc < threshold:
title='Low accuracy',
text=f'Accuracy {acc} is below the acceptable theshold {threshold}',