File size: 697 Bytes
877add7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
"""Structured policy output schema."""

from __future__ import annotations

from pydantic import BaseModel, ConfigDict, Field

from app.common.enums import ActionType, DecisionMode, DoseBucket


class DecisionSchema(BaseModel):
    model_config = ConfigDict(extra="forbid")
    mode: DecisionMode
    action_type: ActionType
    target_drug: str | None
    replacement_drug: str | None
    dose_bucket: DoseBucket
    taper_days: int | None
    monitoring_plan: str | None
    evidence_query: str | None = None
    new_drug_name: str | None = None
    candidate_components: list[str] = Field(default_factory=list)
    candidate_id: str
    confidence: float
    rationale_brief: str | None = None