15 lines
433 B
Python
15 lines
433 B
Python
from typing import Literal
|
|
|
|
from pydantic import BaseModel, Field
|
|
|
|
|
|
class TriageResult(BaseModel):
|
|
service: str = Field(min_length=1)
|
|
severity: Literal["low", "medium", "high", "critical"]
|
|
confidence: float = Field(ge=0.0, le=1.0)
|
|
recommended_action: str = Field(min_length=1)
|
|
|
|
|
|
def parse_triage_result(raw_json: str) -> TriageResult:
|
|
raise NotImplementedError("Użyj TriageResult.model_validate_json(raw_json)")
|