Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -28,10 +28,8 @@ DEADLINE_HOUR = 23 # 11 PM IST
|
|
| 28 |
# Intern registry β add/remove interns here
|
| 29 |
# Format: { "slack_user_id": "Full Name" }
|
| 30 |
INTERN_REGISTRY = {
|
| 31 |
-
# Add your interns below. Example:
|
| 32 |
-
|
| 33 |
"U084C0HQLKS": "Khushi Mishra",
|
| 34 |
-
"U0AFNM2H88G": "Roshesh Shah"
|
| 35 |
}
|
| 36 |
|
| 37 |
# βββ CLIENTS (lazy-init from env) βββββββββββββββββββββββββββββββββββββββββββββ
|
|
@@ -318,32 +316,21 @@ def run_evaluation(custom_interns_json: str = "") -> str:
|
|
| 318 |
alert_channel_id = ALERT_CHANNEL_ID
|
| 319 |
log.append(f" Using #intern-updates ({ALERT_CHANNEL_ID})")
|
| 320 |
|
| 321 |
-
# 5.
|
| 322 |
-
|
| 323 |
-
|
| 324 |
-
|
| 325 |
-
|
| 326 |
-
|
| 327 |
-
|
| 328 |
-
except SlackApiError as e:
|
| 329 |
-
log.append(f" β Failed to post summary: {e.response['error']}")
|
| 330 |
-
|
| 331 |
-
# 6. Also post summary to #ai-vidya
|
| 332 |
-
try:
|
| 333 |
-
slack_client.chat_postMessage(channel=REPORT_CHANNEL_ID, text=summary_msg)
|
| 334 |
-
log.append(" Summary also posted to #ai-vidya.")
|
| 335 |
-
except SlackApiError as e:
|
| 336 |
-
log.append(f" Could not post to #ai-vidya: {e.response['error']}")
|
| 337 |
|
| 338 |
-
|
| 339 |
-
|
| 340 |
-
|
| 341 |
-
|
| 342 |
-
|
| 343 |
-
else:
|
| 344 |
-
log.append("\nAll interns submitted β no missed alerts needed.")
|
| 345 |
else:
|
| 346 |
-
log.append(
|
| 347 |
|
| 348 |
log.append("\n" + "=" * 55)
|
| 349 |
log.append("β
Evaluation complete.")
|
|
@@ -352,7 +339,7 @@ def run_evaluation(custom_interns_json: str = "") -> str:
|
|
| 352 |
|
| 353 |
# βββ GRADIO UI ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 354 |
INTERN_REGISTRY_EXAMPLE = json.dumps({
|
| 355 |
-
|
| 356 |
"U084C0HQLKS": "Khushi Mishra",
|
| 357 |
"U0AFNM2H88G": "Roshesh Shah",
|
| 358 |
}, indent=2)
|
|
|
|
| 28 |
# Intern registry β add/remove interns here
|
| 29 |
# Format: { "slack_user_id": "Full Name" }
|
| 30 |
INTERN_REGISTRY = {
|
|
|
|
|
|
|
| 31 |
"U084C0HQLKS": "Khushi Mishra",
|
| 32 |
+
"U0AFNM2H88G": "Roshesh Shah",
|
| 33 |
}
|
| 34 |
|
| 35 |
# βββ CLIENTS (lazy-init from env) βββββββββββββββββββββββββββββββββββββββββββββ
|
|
|
|
| 316 |
alert_channel_id = ALERT_CHANNEL_ID
|
| 317 |
log.append(f" Using #intern-updates ({ALERT_CHANNEL_ID})")
|
| 318 |
|
| 319 |
+
# 5. Build and post full message to #ai-vidya only
|
| 320 |
+
summary_msg = build_slack_message(results, evals, run_time)
|
| 321 |
+
try:
|
| 322 |
+
slack_client.chat_postMessage(channel=REPORT_CHANNEL_ID, text=summary_msg)
|
| 323 |
+
log.append(" Summary posted to #ai-vidya.")
|
| 324 |
+
except SlackApiError as e:
|
| 325 |
+
log.append(f" Could not post to #ai-vidya: {e.response['error']}")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 326 |
|
| 327 |
+
# 6. Send @mention alerts to #ai-vidya
|
| 328 |
+
missed_count = sum(1 for r in results.values() if not r["submitted"])
|
| 329 |
+
if missed_count:
|
| 330 |
+
log.append(f"\nSending {missed_count} missed report alert(s) to #ai-vidya...")
|
| 331 |
+
send_missed_alerts(slack_client, REPORT_CHANNEL_ID, results, log)
|
|
|
|
|
|
|
| 332 |
else:
|
| 333 |
+
log.append("\nAll interns submitted β no missed alerts needed.")
|
| 334 |
|
| 335 |
log.append("\n" + "=" * 55)
|
| 336 |
log.append("β
Evaluation complete.")
|
|
|
|
| 339 |
|
| 340 |
# βββ GRADIO UI ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 341 |
INTERN_REGISTRY_EXAMPLE = json.dumps({
|
| 342 |
+
"U06T83LP86P": "Mann Vishnoi",
|
| 343 |
"U084C0HQLKS": "Khushi Mishra",
|
| 344 |
"U0AFNM2H88G": "Roshesh Shah",
|
| 345 |
}, indent=2)
|