schemas.py 727 B

1234567891011
  1. from pydantic import BaseModel, Field
  2. from typing import List, Optional
  3. class ExtractionResponse(BaseModel):
  4. provider_name: str = Field(description="The name of the clinic or hospital.")
  5. visit_date: str = Field(description="The date of service in YYYY-MM-DD format.")
  6. total_amount: float = Field(description="The total amount paid.")
  7. currency: str = Field(description="3-letter currency code (e.g. USD, SGD).")
  8. items: List[str] = Field(description="Simplified list of services (e.g. 'Consultation', 'Medicine').")
  9. confidence_score: float = Field(description="Model's confidence from 0.0 to 1.0.")
  10. needs_manual_review: bool = Field(description="Set to true if text is blurry or data is ambiguous.")