File size: 1,139 Bytes
90c670b
 
 
 
 
 
 
 
17b209e
90c670b
 
 
 
 
 
 
 
 
 
17b209e
90c670b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
from pydantic import BaseModel, Field
from typing import List, Optional

class InvoiceSchema(BaseModel):
    vendor: str = Field(description="Name of the company or service provider")
    total_amount: float = Field(description="Total cost extracted")
    currency: str = Field(description="Currency code (USD, EUR, NGN)", default="USD")
    date: str = Field(description="Date of transaction (YYYY-MM-DD) or 'Unknown'")
    is_paid: bool = Field(description="Payment status")
    items: List[str] = Field(description="List of line items purchased", default_factory=list)

class ResumeSchema(BaseModel):
    name: str = Field(description="Candidate's full name")
    email: Optional[str] = Field(description="Email address")
    skills: List[str] = Field(description="Technical skills found")
    years_experience: int = Field(description="Estimated years of experience", default=0)
    summary: str = Field(description="Brief professional summary")

class GenericSchema(BaseModel):
    key_points: List[str] = Field(description="Main takeaways or extracted facts")
    sentiment: str = Field(description="Positive, Neutral, or Negative")