Spaces:
Runtime error
Runtime error
| from pydantic import BaseModel, Field | |
| from typing import Optional, List | |
| from datetime import datetime | |
| class Bill(BaseModel): | |
| name: str | |
| amount: float | |
| due_date: str # YYYY-MM-DD format | |
| category: str | |
| recurring: bool = False | |
| auto_pay: bool = False | |
| class Config: | |
| schema_extra = { | |
| "example": { | |
| "name": "Electricity", | |
| "amount": 1500.0, | |
| "due_date": "2025-07-05", | |
| "category": "Bills & Utilities", | |
| "recurring": True, | |
| "auto_pay": False | |
| } | |
| } | |
| class Bills(BaseModel): | |
| bills: List[Bill] | |
| class Config: | |
| schema_extra = { | |
| "example": { | |
| "bills": [ | |
| { | |
| "name": "Electricity", | |
| "amount": 1500.0, | |
| "due_date": "2025-07-05", | |
| "category": "Bills & Utilities", | |
| "recurring": True, | |
| "auto_pay": False | |
| }, | |
| { | |
| "name": "Rent", | |
| "amount": 15000.0, | |
| "due_date": "2025-07-01", | |
| "category": "Bills & Utilities", | |
| "recurring": True, | |
| "auto_pay": True | |
| } | |
| ] | |
| } | |
| } |