price-builder-backend/schemas/schemas.py

36 lines
623 B
Python
Raw Permalink Normal View History

2024-10-13 16:38:23 +04:00
from pydantic import BaseModel
from typing import Optional
2024-10-13 16:38:23 +04:00
class LaptopCreate(BaseModel):
brand: str
2024-10-13 16:38:23 +04:00
processor: str
ram: int
os: str
ssd: int
display: float
gpu: str
weight: float
battery_size: int
release_year: int
display_type: str
2024-10-13 16:38:23 +04:00
class LaptopResponse(BaseModel):
id: int
brand: str
2024-10-13 16:38:23 +04:00
processor: str
ram: int
os: str
ssd: int
display: float
gpu: str
weight: float
battery_size: int
release_year: int
display_type: str
2024-10-13 16:38:23 +04:00
class Config:
orm_mode = True
class PredictPriceResponse(BaseModel):
predicted_price: float