Slack notifications
Recipe — route Stratix evaluation results into a Slack channel by polling and forwarding.
import os, requests
from layerlens import Stratix
client = Stratix()
evaluation = client.evaluations.get(EVAL_ID)
if not evaluation.is_success:
requests.post(
os.environ["SLACK_WEBHOOK_URL"],
json={
"text": f"⚠️ Stratix evaluation {evaluation.id} status={evaluation.status}",
"attachments": [{
"color": "danger",
"fields": [
{"title": "Model", "value": evaluation.model_name, "short": True},
{"title": "Benchmark", "value": evaluation.benchmark_name, "short": True},
{"title": "Accuracy", "value": str(evaluation.accuracy), "short": True},
],
}],
},
timeout=10,
)See also
Last updated
Was this helpful?