feat: complete production hardening implementation, specialty canonicalization, google-genai migration, voice reliability, sqlite concurrency, and test suite consolidation
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
"""
|
||||
Extraction result and question intent domain models.
|
||||
"""
|
||||
|
||||
from typing import Any, Dict, List, Optional
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
|
||||
class ExtractedFact(BaseModel):
|
||||
category: str # 'symptom', 'medication', 'allergy', 'medical_history', 'family_history', etc.
|
||||
data: Dict[str, Any]
|
||||
|
||||
|
||||
class ExtractionResult(BaseModel):
|
||||
raw_message: str
|
||||
normalized_message: str
|
||||
detected_language: str = "en"
|
||||
updates: Dict[str, Any] = Field(default_factory=dict)
|
||||
is_emergency: bool = False
|
||||
is_crisis: bool = False
|
||||
emergency_reason: Optional[str] = None
|
||||
|
||||
|
||||
class QuestionIntent(BaseModel):
|
||||
intent_code: str # e.g., 'reason_for_visit', 'symptom_duration', 'medical_history'
|
||||
field: str
|
||||
attribute: Optional[str] = None
|
||||
target_symptom: Optional[str] = None
|
||||
Reference in New Issue
Block a user