banao-tech commited on
Commit
f6e683d
Β·
verified Β·
1 Parent(s): f82eebd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -28
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. Post summary to #intern-updates
322
- if alert_channel_id:
323
- log.append(f"\nπŸ“€ Posting summary to #{ALERT_CHANNEL_ID}...")
324
- summary_msg = build_slack_message(results, evals, run_time)
325
- try:
326
- slack_client.chat_postMessage(channel=alert_channel_id, text=summary_msg)
327
- log.append(" βœ… Summary posted.")
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
- # 7. Send individual missed alerts
339
- missed_count = sum(1 for r in results.values() if not r["submitted"])
340
- if missed_count:
341
- log.append(f"\nSending {missed_count} missed report alert(s)...")
342
- send_missed_alerts(slack_client, alert_channel_id, results, log)
343
- else:
344
- log.append("\nAll interns submitted β€” no missed alerts needed.")
345
  else:
346
- log.append(f"⚠️ Skipping Slack post β€” #{ALERT_CHANNEL_ID} not found.")
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)