Spaces:
Runtime error
Runtime error
| from pydantic import BaseModel, Field | |
| from typing import Dict, Optional | |
| class Budget(BaseModel): | |
| category: str | |
| limit: float | |
| spent: float = 0.0 | |
| class Config: | |
| schema_extra = { | |
| "example": { | |
| "category": "Food & Dining", | |
| "limit": 8000.0, | |
| "spent": 4500.0 | |
| } | |
| } | |
| class Budgets(BaseModel): | |
| budgets: Dict[str, Budget] | |
| class Config: | |
| schema_extra = { | |
| "example": { | |
| "budgets": { | |
| "Food & Dining": { | |
| "category": "Food & Dining", | |
| "limit": 8000.0, | |
| "spent": 4500.0 | |
| }, | |
| "Transportation": { | |
| "category": "Transportation", | |
| "limit": 3000.0, | |
| "spent": 1500.0 | |
| } | |
| } | |
| } | |
| } |