Skip to content

Commit 7408842

Browse files
authored
Merge pull request #77 from MLAI-AUS-Inc/medhack-frontiers-skill
Only show case image on daily post and repost requests
2 parents 96e2aa4 + 0620d43 commit 7408842

File tree

1 file changed

+22
-6
lines changed

1 file changed

+22
-6
lines changed

roo-standalone/roo/skills/executor.py

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -349,10 +349,26 @@ async def _execute_medhack(
349349
"Do NOT reveal the correct diagnosis or hint at it."
350350
)
351351
guess_warning = f"\n\n_You have *{remaining}* guess{'es' if remaining != 1 else ''} remaining._"
352-
return self._medhack_game_response(
353-
llm_response + guess_warning,
354-
current_case.get("image_url", "")
355-
)
352+
return llm_response + guess_warning
353+
354+
# --- Repost the daily case (with image) ---
355+
repost_patterns = ["post the", "show the case", "show me the case",
356+
"post again", "start again", "from the start",
357+
"show the patient", "post the patient",
358+
"present the case", "daily patient"]
359+
if current_case and any(p in text_lower for p in repost_patterns):
360+
complaint = current_case.get("ed_first_look") or current_case.get("presenting_complaint", "")
361+
title = current_case.get("title", "Daily Case")
362+
header = f"*Guess the Diagnosis — {title}*"
363+
message = (
364+
f"{header}\n\n"
365+
f"{complaint}\n\n"
366+
f"Ask me questions about this patient to work towards the diagnosis. "
367+
f"When you're ready, tell me your diagnosis!\n\n"
368+
f"_You have 3 guesses. First correct answer wins 12 MLAI points "
369+
f"+ DM Dr Sam for a free ticket code to MedHack: Frontiers!_"
370+
)
371+
return self._medhack_game_response(message, current_case.get("image_url", ""))
356372

357373
# --- Game interaction (not a guess) ---
358374
if is_game_q and current_case:
@@ -380,7 +396,7 @@ async def _execute_medhack(
380396

381397
case_data = client.get_case_for_llm(today)
382398
llm_response = await self._medhack_llm_response(skill, text, case_data, thread_history)
383-
return self._medhack_game_response(llm_response, current_case.get("image_url", ""))
399+
return llm_response
384400

385401
if is_game_q and not current_case:
386402
return (
@@ -400,7 +416,7 @@ async def _execute_medhack(
400416
)
401417
case_data = client.get_case_for_llm(today)
402418
llm_response = await self._medhack_llm_response(skill, text, case_data, thread_history)
403-
return self._medhack_game_response(llm_response, current_case.get("image_url", ""))
419+
return llm_response
404420

405421
# --- Event info mode ---
406422
if is_event_q or (not is_game_q):

0 commit comments

Comments
 (0)