Spaces:
Running
Running
| """Abstention policy helpers.""" | |
| from __future__ import annotations | |
| from app.common.enums import ActionType, DecisionMode, DoseBucket | |
| from app.common.types import PolyGuardAction | |
| def abstain_action(reason: str = "uncertainty_high") -> PolyGuardAction: | |
| return PolyGuardAction( | |
| mode=DecisionMode.REVIEW, | |
| action_type=ActionType.REQUEST_SPECIALIST_REVIEW, | |
| target_drug=None, | |
| replacement_drug=None, | |
| dose_bucket=DoseBucket.NA, | |
| taper_days=None, | |
| monitoring_plan=reason, | |
| candidate_id="cand_abstain", | |
| confidence=0.5, | |
| rationale_brief=f"Abstaining due to {reason}", | |
| ) | |