| 1234567891011121314151617181920212223242526272829 |
- from pydantic import BaseModel, Field
- from typing import List, Optional
- from uuid import UUID
- from datetime import datetime
- class UserAccount(BaseModel):
- id: str = Field(description="Unique identifier for the user.")
- name: str = Field(description="Full name of the employee.")
- department: str = Field(description="Department name.")
- medical_allowance: float = Field(description="Remaining annual medical allowance in MYR.")
- class ExtractionResponse(BaseModel):
- provider_name: str = Field(description="The name of the clinic or hospital.")
- visit_date: str = Field(description="The date of service in YYYY-MM-DD format.")
- total_amount: float = Field(description="The total amount paid.")
- currency: str = Field(description="3-letter currency code (e.g. USD, SGD).")
- items: List[str] = Field(description="Simplified list of services (e.g. 'Consultation', 'Medicine').")
- confidence_score: float = Field(description="Model's confidence from 0.0 to 1.0.")
- needs_manual_review: bool = Field(description="Set to true if text is blurry or data is ambiguous.")
- ai_reasoning: str = Field(description="A brief explanation of how the data was identified.")
- class ClaimRecord(BaseModel):
- id: str = Field(description="Unique identifier for the claim record.")
- timestamp: str = Field(description="ISO format timestamp of submission.")
- submitted_by: str = Field(description="Name of the user who submitted the claim.")
- department: str = Field(description="Department of the user.")
- amount_spent: float = Field(description="The raw total amount from the receipt.")
- amount_claimed: float = Field(description="The actual amount credited after policy capping.")
- extraction_data: ExtractionResponse = Field(description="The AI-extracted data for this claim.")
|